Drop Down

This is a Drop Down component.

Installation

1. Dependencies

npm install clsx tailwind-merge framer-motion

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Drop Down Code

Loading...

Copy Drop Down Code

DropdownMenu Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe dropdown menu content.
classNamestringNo""Additional class names for styling.

DropdownMenuTrigger Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe trigger element for the dropdown.
onClick() => voidNoundefinedCallback when the trigger is clicked.
classNamestringNo""Additional class names for styling.

DropdownMenuContent Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe dropdown menu items.
classNamestringNo""Additional class names for styling.
align"left" | "right" | "center"No"left"Alignment of the dropdown content.
isOpenbooleanYesfalseControls whether the dropdown is open.
onClose() => voidYesundefinedCallback to close the dropdown.

DropdownMenuItem Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the dropdown item.
onClick() => voidNoundefinedCallback when the item is clicked.
classNamestringNo""Additional class names for styling.

DropdownMenuCheckboxItem Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the checkbox item.
onClick() => voidNoundefinedCallback when the checkbox is clicked.
classNamestringNo""Additional class names for styling.

DropdownMenuRadioItem Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the radio item.
onClick() => voidNoundefinedCallback when the radio item is clicked.
classNamestringNo""Additional class names for styling.

DropdownMenuLabel Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe label content.
classNamestringNo""Additional class names for styling.

DropdownMenuSeparator Props

NameTypeRequiredDefaultDescription
classNamestringNo""Additional class names for styling.

DropdownMenuShortcut Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe shortcut content (e.g., keyboard shortcuts).
classNamestringNo""Additional class names for styling.

DropdownMenuGroup Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe group content.
classNamestringNo""Additional class names for styling.

DropdownMenuPortal Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe portal content to render outside the DOM hierarchy.

DropdownMenuSub Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe submenu content.
classNamestringNo""Additional class names for styling.

DropdownMenuSubContent Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe submenu content items.
classNamestringNo""Additional class names for styling.
isOpenbooleanYesfalseControls whether the submenu is open.
onClose() => voidYesundefinedCallback to close the submenu.

DropdownMenuSubTrigger Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe trigger element for the submenu.
onClick() => voidNoundefinedCallback when the submenu trigger is clicked.
classNamestringNo""Additional class names for styling.

DropdownMenuRadioGroup Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe radio group content.
classNamestringNo""Additional class names for styling.