43 Pro components and page blocks

Get Pro

Dropdown Menu

New

Preview

Customize

Below
Start
Offset6px

Usage

import { DropdownMenu } from "@/components/uibrik/dropdown-menu/dropdown-menu";

<DropdownMenu items={items}>…</DropdownMenu>

Installation

npx shadcn@latest add https://uibrik.com/r/dropdown-menu.json
Adds the files to components/uibrik/dropdown-menu and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/dropdown-menu.

Props

DropdownMenu
side
Type "bottom" | "top" | "right" | "left"
"bottom"
Preferred side. Flips when there isn't room.
align
Type "start" | "center" | "end"
"start"
Which edge of the button the menu lines up with.
offset
Type number
6
Gap between button and menu.
childrenrequired
Type ReactNode
–
The button that opens the menu.
itemsrequired
Type MenuItem[]
–
{ label, icon?, shortcut?, onSelect?, danger?, disabled? }, or with type: checkbox (checked, onCheckedChange), radio (checked, onSelect), sub (items), label, separator.
open / onOpenChange
Type boolean / (open) => void
–
Controlled open state.
className
Type string
–
Classes for the menu panel.