• Docs
  • Components
  • Dropdown

Dropdown - Aspect UI

The Dropdown component displays a list of options that users can select from. It supports triggers, keyboard navigation, icons, nested items, and controlled or uncontrolled modes.

Table of Contents#


PropTypeDefaultDescription
childrenReactNode-The content of the dropdown, usually containing DropdownAction and DropdownContent.
hoverbooleanfalseWhether the dropdown opens on hover instead of click.
hoverDelaynumber0Delay in milliseconds before opening the dropdown on hover.
closeDelaynumber100Delay in milliseconds before closing the dropdown after hover ends.
directiontop bottom left right'bottom'The direction in which the dropdown content appears relative to the action button.

PropTypeDefaultDescription
childrenReactNode-The trigger element for the dropdown, such as a button or label.
classNamestring''Additional CSS classes for styling the action trigger.
iconReactElement-An optional icon to display inside the action trigger.
iconPositionstart end'end'Position of the icon relative to the text.
...restHTMLAttributes-Any other props are spread onto the action element.

PropTypeDefaultDescription
childrenReactNode-The content displayed inside the dropdown when open.
classNamestring''Additional CSS classes for the dropdown content wrapper.
...restHTMLAttributes<HTMLDivElement>-Any other props are spread onto the dropdown content container.

PropTypeDefaultDescription
childrenReactNode-The content inside the dropdown item, such as text or a link.
onClick() => void-Callback function when the item is clicked.
classNamestring''Additional CSS classes for the dropdown item.
activeClassNamestring''CSS class applied when the item is active or selected.
isSelectedbooleanfalseMarks the item as selected.
isLinkbooleanfalseIndicates if the item is rendered as a link.
...restHTMLAttributes-Any other props are spread onto the dropdown item element.

PropTypeDefaultDescription
childrenReactNode-The list of dropdown items to display.
classNamestring''Additional CSS classes for the dropdown list wrapper.
...restHTMLAttributes-Any other props are spread onto the dropdown list container.