Components
DropdownMenu
Anchored menu opened from its children trigger.
On iOS this is a native UIMenu; what renders here is the Material popover.
Items are data, not JSX — each needs a unique actionKey, which is what
onItemPress reports back.
<View className="items-start">
<DropdownMenu {...args}>
<Button variant="tonal">
<Text>Actions</Text>
</Button>
</DropdownMenu>
</View>Import
import { DropdownMenu } from '@simal/ui/nativewindui';Props
| Prop | Values | Default | Description |
|---|---|---|---|
items | — | [] | Menu entries. Supports icon, state: { checked } for a checkmark, destructive, and subMenu for one nested level. |
onItemPress | — | — | Fires with the pressed item. Match on actionKey, not title. |
children | — | — | The trigger. Tapping it opens the menu anchored to that element — there is no imperative open method. |
Examples
With Icons And State
<View className="items-start">
<DropdownMenu {...args}>
<Button variant="tonal">
<Text>Sort</Text>
</Button>
</DropdownMenu>
</View>With Sub Menu
Nested submenus and disabled entries.
<View className="items-start">
<DropdownMenu {...args}>
<Button variant="tonal">
<Text>More</Text>
</Button>
</DropdownMenu>
</View>