Atoms
Dropdown Menu
Opens a menu when the user clicks a trigger.
shadcn/uiBased on shadcn/ui with Formance brand styling.
Installation#
npx shadcn@latest add @formance/dropdown-menuInstall the following dependencies:
npm install radix-ui lucide-reactCopy and paste the following code into your project.
Update the import paths to match your project setup.
Usage#
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger,} from '@/components/ui/dropdown-menu'<DropdownMenu> <DropdownMenuTrigger>Open</DropdownMenuTrigger> <DropdownMenuContent> <DropdownMenuItem>View Transaction</DropdownMenuItem> <DropdownMenuItem>Copy ID</DropdownMenuItem> <DropdownMenuItem variant="destructive">Delete</DropdownMenuItem> </DropdownMenuContent></DropdownMenu>Examples#
With Icons#
Checkboxes#
Radio Group#
Submenu#
Plain Label#
DropdownMenuLabel is a heading over a group of items by default
(variant="section"): uppercase, with wide tracking. For other content in the
label slot, such as the signed-in user or a summary sentence, use
variant="plain". It keeps the case of its children.