Dropdown
A trigger-driven menu surface for contextual actions.
DropdownView sourceExample
The preview is interactive. The code below it is the docs demo source; demo-only layout classes can be omitted in application code.
import { Cell } from "retend";
import { Button, Dropdown } from "innate-ui";
import { Icon } from "@/docs/icons/Icon";
export function DropdownDemo() {
const selected = Cell.source("");
return (
<Dropdown value={selected} onChange={(value) => selected.set(value)}>
<Dropdown.Trigger>
<Button>
<Button.Start>
<Icon name="plus" />
</Button.Start>
Add
</Button>
</Dropdown.Trigger>
<Dropdown.Content>
<Dropdown.Item value="worker" label="Worker" />
<Dropdown.Item value="pages" label="Pages" />
</Dropdown.Content>
</Dropdown>
);
}API reference
This table is generated from Innate UI's exported TypeScript declarations and JSDoc. Native element attributes inherited by a prop type are not repeated here.
DropdownProps
| Prop | Type | Default |
|---|---|---|
childrenrequiredDropdown trigger, value, content, and item parts. | JSX.Children | — |
valueCurrently selected item value. | JSX.ValueOrCell<Value> | — |
onChangeCalled when an item is selected. | (value: Value) => void | — |
openWhether the popover is open. | JSX.ValueOrCell<boolean> | false |
sidePreferred side of the anchor. | JSX.ValueOrCell<PopoverSide> | "bottom" |
alignPreferred alignment along the anchor edge. | JSX.ValueOrCell<PopoverAlign> | "center" |
onOpenChangeCalled when the popover requests an open-state change. | (open: boolean, reason?: PopoverCloseReason) => void | — |