Skip to content
Drivn

Dropdown

Composable dropdown menu with dot notation, icons, and click-outside to close.

Preview

Actions
More

Installation

npx drivn add dropdown

Usage

1import { Dropdown } from "@/components/ui/dropdown"
2import { Edit, Trash2 } from "lucide-react"
3
4export default function Page() {
5 return (
6 <Dropdown>
7 <Dropdown.Trigger>Menu</Dropdown.Trigger>
8 <Dropdown.Content>
9 <Dropdown.Item icon={Edit}>
10 Edit
11 </Dropdown.Item>
12 <Dropdown.Item icon={Trash2} destructive>
13 Delete
14 </Dropdown.Item>
15 </Dropdown.Content>
16 </Dropdown>
17 )
18}

API Reference

Dropdown

PropTypeDefaultDescription
align"left" | "right""left"Horizontal alignment of the menu relative to the trigger
classNamestring—Additional CSS classes to apply to the dropdown container
childrenReactNode—Dropdown sub-components (Trigger, Content, Item)

Dropdown.Item

PropTypeDefaultDescription
onClick() => void—Callback fired when the item is clicked
iconComponentType | ReactElement—Icon component (Edit) or element (<Edit className="..." />)
destructiveboolean—Applies destructive styling to the item
childrenReactNode—Item label content

Dropdown.Group

PropTypeDefaultDescription
childrenReactNode—Group content (Label, Item, Separator)
classNamestring—Additional CSS classes to apply

Dropdown.Label

PropTypeDefaultDescription
childrenReactNode—Label text content
classNamestring—Additional CSS classes to apply

Dropdown.Separator

PropTypeDefaultDescription
classNamestring—Additional CSS classes to apply