Dropdown API
import { Dropdown } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
align | 'start' | 'end' | Which trigger edge the menu lines up with. Unset: the start edge, or the end edge when the menu would otherwise run off the window. |
children | React.ReactNode | |
closeOnSelect | boolean | |
density | 'default' | 'compact' | 'comfortable' | |
elevation | 'default' | 'none' | 'low' | 'high' | |
onChange | (open: boolean) => void | |
onChangeDetail | (detail: { open: boolean; reason?: string }) => void | |
onClose | () => void | |
onOpen | () => void | |
onRequestClose | (detail: { reason: string }) => void | |
onSelect | (detail: { value?: string; label?: string; checked?: boolean; item?: HTMLElement }) => void | |
open | boolean | |
placement | 'top' | 'bottom' | 'left' | 'right' | |
radius | number | string | |
shape | 'default' | 'square' | 'soft' | 'rounded' | 'pill' | |
size | 'sm' | 'md' | 'lg' | '1' | '2' | '3' | |
tone | 'default' | 'brand' | 'neutral' | 'info' | 'danger' | 'success' | 'warning' | |
typeahead | boolean | |
variant | | 'default' | 'surface' | 'soft' | 'filled' | 'outline' | 'flat' | 'line' | 'minimal' | 'ghost' | 'glass' | 'solid' | 'contrast' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Dropdown.Trigger props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Dropdown.Content props
| Prop | Type | Description |
|---|---|---|
as | 'div' | 'section' | 'ul' | 'nav' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Dropdown.Item props
| Prop | Type | Description |
|---|---|---|
caption | React.ReactNode | |
checked | boolean | |
children | React.ReactNode | |
icon | React.ReactNode | An Editora icon name ("settings"), or your own element. |
label | string | |
role | DropdownItemRole | |
shortcut | React.ReactNode | |
tone | 'danger' | 'success' | 'warning' | |
value | string |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Dropdown.Separator props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Dropdown.SectionLabel props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-dropdown>
Dropdown renders the ui-dropdown custom element from @editora/ui-core, which can also be used without React.
Attributes: align, aria-describedby, aria-label, aria-labelledby, close-on-scroll, close-on-select, density, disabled, elevation, open, placement, radius, shape, size, tone, typeahead, variant
Events: change, close, open, request-close, select, ui-request-close