DropDown
Menu opened from a trigger.
When to use
Use DropDown when you need menu opened from a trigger.
Import
TypeScript
import { DropDown } from '@gzodo/ui'DropDown is a compound menu: Trigger, Content, and Item. The trigger can be any node, usually a Button or IconButton. Items call onClick when chosen and close the menu. Positioning, Escape, and outside click are handled inside the library.
Examples
3Basic
The trigger is a button. Each item is a row with hover border and a muted label.
Icon trigger
Put an IconButton in the trigger for a compact overflow menu. Give the button a title.
Disabled trigger
isDisabled on the trigger blocks the menu from opening.DropDown
2DropDown
Property
Description
Type
Default
childrenTrigger and Content.
ReactNode—
classNameClass on the root.
string—
DropDown.Trigger
2DropDown.Trigger
Property
Description
Type
Default
childrenThe element that opens the menu.
ReactNode—
isDisabledPrevents the menu from opening.
boolean—
DropDown.Item
2DropDown.Item
Property
Description
Type
Default
childrenRow label, optionally with an icon.
ReactNode—
onClickCalled when the item is chosen.
() => void—