Dropdown

A dropdown menu displays a list of choices on a temporary surface. They appear when users interact with a button, action, or other control.

Props (Dropdown)

PropTypeDefaultDescription
buttonContentReactNode-The content displayed inside the dropdown's trigger button.
childrenReactNode-The dropdown menu items, typically `Dropdown.Item` components.
buttonClassNamestring''Optional classes to apply to the trigger button.

Props (Dropdown.Item)

PropTypeDescription
childrenReactNodeThe content of the dropdown item.
...propsanyAny other props are passed to the underlying `a` tag.

Examples

Basic Dropdown

A standard dropdown menu triggered by a button. Built with Headless UI for accessibility.

import Dropdown from '@/components/Dropdown';

export default function MyComponent() {
  return (
    <Dropdown buttonContent="Options">
      <Dropdown.Item href="#">Account settings</Dropdown.Item>
      <Dropdown.Item href="#">Support</Dropdown.Item>
      <Dropdown.Item href="#">License</Dropdown.Item>
      <Dropdown.Item onClick={() => alert('Signing out!')}>
        Sign out
      </Dropdown.Item>
    </Dropdown>
  );
}