Skip to content
Browse library
BIU UI/Components/Dropdown Menu
COMPONENTS

Dropdown Menu

Explore the Dropdown Menu component and try its interactive examples.

INTERACTIVE PREVIEW

Preview

Install the components for this example with pnpm dlx shadcn add @biudev/dropdown-menu @biudev/button. Then run pnpm add lucide-react.

Loading preview…
GET STARTED

Installation

Install the component source via shadcn Registry, the BIU CLI, or as an npm package.

TERMINAL / pnpm
pnpm dlx shadcn add @biudev/dropdown-menu

First time using @biudev? Map "@biudev": "https://ui.biu.dev/r/0.1.0/{name}.json" under registries in your components.json (see setup).

Usage

Start with this example, then adjust the import path for your project.

Install the components for this example with pnpm dlx shadcn add @biudev/dropdown-menu @biudev/button.

EXAMPLE / TSX
import { useState } from "react";
import { Button } from "@/components/ui/biu/button";
import { DropdownMenu } from "@/components/ui/biu/dropdown-menu";

export function Example() {
  const [action, setAction] = useState("");
  return (
    <div>
      <DropdownMenu
        trigger={<Button variant="secondary">Actions</Button>}
        items={[
          { label: "Edit", onSelect: () => setAction("Edit") },
          { label: "Archive", onSelect: () => setAction("Archive") },
        ]}
      />
      <p role="status">{action}</p>
    </div>
  );
}

Examples

Try each example or switch to its code.

API reference

Properties and defaults from the component source. An asterisk marks a required property; a dash means no explicit default.

DropdownMenuItem

DropdownMenuProps

Source

Review a formatted version of the component source used by the Registry.