Skip to content

Browse components

← All components

Dropdown

Friendlier aliases over Menu — DropdownTrigger, DropdownMenu, DropdownItem.

Install
npx shadcn@latest add https://ui.anuragroy.dev/r/dropdown.json

Preview

Loading preview…

Installation

Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.

Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/dropdown.json

GitHub fallback if the website is down:

Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/dropdown.json

Usage

Import paths follow your components.json aliases. After install, the default path is @/components/ui/dropdown.

Import
import {  Dropdown,  DropdownItem,  DropdownMenu,  DropdownSeparator,  DropdownTrigger} from "@/components/ui/dropdown"
example.tsx
import { Button } from "@/components/ui/button"import {  Dropdown,  DropdownItem,  DropdownMenu,  DropdownSeparator,  DropdownTrigger,} from "@/components/ui/dropdown"export function Example() {  return (    <Dropdown>      <DropdownTrigger render={<Button variant="outline" />}>        Open      </DropdownTrigger>      <DropdownMenu>        <DropdownItem>Profile</DropdownItem>        <DropdownItem>Settings</DropdownItem>        <DropdownSeparator />        <DropdownItem>Log out</DropdownItem>      </DropdownMenu>    </Dropdown>  )}

API Reference

Dropdown

Re-exports the Menu root under a shorter name.

PropTypeDefault
openboolean—
onOpenChange(open: boolean) => void—

Notes

  • Installing `dropdown` also installs `menu`. Prefer `dropdown` for typical menus.