item
Last updated
Last updated
An item
within a context-menu
should make it clear to the user what will happen when they select that item
. An item
has a label
, an associated action (via its on-press
attribute) and optionally an icon
.
Best practices
Naming an item: Give an item
a short, concise name. Use action words only if the item triggers an action.
Icons: Really consider the role that icons play. They are meant to supplement communication and should almost be able to portray a concept without accompanying text - so choose them wisely.
Apply icons to all child items within one group, or none.
icon
Optional
Type: string
Default: unset
The icon to display on the item
, it will be placed on the left of the label
by default. The icon
can be a Font Awesome icon, an Ionicons icon or a png icon asset.
label
Optional
Type: string
(static text, a format string or the return value of a JS/TS function)
Default: Unset
The text that appears on the item
to describe it.
on-press
Note: When constructing an item from JavaScript/TypeScript, use onPress
, i.e.:
from-js
Optional
Default: unset
Construct a context-menu
item
from JavaScript/TypeScript.
validate
Optional
Type: boolean
Default: false
Set to true
to ensure that no required input fields in the current view are empty before performing the on-press
action.
show-if
and hide-if