
A Simple set of components allowing you to create dropdowns.
Usage
import {
DropDown,
DropDownTrigger,
DropDownMenu,
DropDownItem
} from '@admin-bro/design-system'
return (
<DropDown>
<DropDownTrigger>
<Button>
<Icon icon="OverflowMenuHorizontal" />
This is trigger
</Button>
</DropDownTrigger>
<DropDownMenu>
<DropDownItem>
<Link href="/some">
<Icon icon="Video" />
Some menu item
</Link>
</DropDownItem>
</DropDownMenu>
</DropDown>
)
It contains a couple of sub-components:
DropDown
- an actual wrapper for an entire DropDownDropDownTrigger
- it has to be right inside the DropDown. It is what the user sees when the DropDown is not hoveredDropDownMenu
- wraps elements which are hidden by default. Shown after hovering TriggerDropDownItem
- it is a wrapper for a menu item list. It can next contain either aLink
orButton
.
Props:
- DropDownMenu extends PositionProps, so you can add prop like
top="xl"
- DropDownItem extends SpaceProps
- DropDownTrigger also extends SpaceProps
Example
Type Definitions
object
# DropDownItemProps
Props passed to DropDownItem Extends BoxProps
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
colorVariant |
VariantType |
<optional> |
object
# DropDownMenuProps
Props passed to DropDownMenu element. Extends BoxProps
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
isVisible |
boolean |
<optional> |
|
stick |
DropDownStickProp |
<optional> |