Hero Ui

HeroUI Dropdown

Buttons 1

About

Accessible dropdown menu built on React Aria, from HeroUI v3. A trigger-anchored popover menu supporting plain actions, leading icons, descriptions, keyboard shortcuts (Kbd), grouped sections with headers and separators, disabled items, single and multiple selection with check indicators, a controlled selected state, a danger/destructive variant, and a custom avatar trigger. Full keyboard navigation, typeahead, and focus management. Compound API: Dropdown / Dropdown.Trigger / Dropdown.Popover / Dropdown.Menu / Dropdown.Item / Dropdown.Section / Dropdown.ItemIndicator + Label / Header / Description / Separator / Kbd / Avatar.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds HeroUI Dropdown to your project and fits it to your theme.

Code

How HeroUI Dropdown is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { useState } from "react"

import {
  Button,
  Dropdown,
  Header,
  Label,
  type Selection,
} from "@/components/ui/heroui-dropdown"

export default function Demo() {
  const [selected, setSelected] = useState<Selection>(new Set(["apple"]))

  return (
    <div className="flex min-h-[360px] items-center justify-center p-6">
      <Dropdown>
        <Button aria-label="Menu" variant="secondary">
          Fruit
        </Button>
        <Dropdown.Popover className="min-w-[256px]">
          <Dropdown.Menu
            selectedKeys={selected}
            selectionMode="single"
            onSelectionChange={setSelected}
          >
            <Dropdown.Section>
              <Header>Select a fruit</Header>
              <Dropdown.Item id="apple" textValue="Apple">
                <Dropdown.ItemIndicator />
                <Label>Apple</Label>
              </Dropdown.Item>
              <Dropdown.Item id="banana" textValue="Banana">
                <Dropdown.ItemIndicator />
                <Label>Banana</Label>
              </Dropdown.Item>
              <Dropdown.Item id="cherry" textValue="Cherry">
                <Dropdown.ItemIndicator />
                <Label>Cherry</Label>
              </Dropdown.Item>
            </Dropdown.Section>
            <Dropdown.Item id="orange" textValue="Orange">
              <Dropdown.ItemIndicator />
              <Label>Orange</Label>
            </Dropdown.Item>
            <Dropdown.Item id="pear" textValue="Pear">
              <Dropdown.ItemIndicator />
              <Label>Pear</Label>
            </Dropdown.Item>
          </Dropdown.Menu>
        </Dropdown.Popover>
      </Dropdown>
    </div>
  )
}

Dependencies

More by Hero Ui

View all
  • DatePicker

    DatePicker

    465
  • Chip

    Chip

    440
  •  The Pagination

    The Pagination

    361
  • HeroUI Color Picker

    HeroUI Color Picker

    105
  • Skeleton

    Skeleton

    104
  • HeroUI Table

    HeroUI Table

    100
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    94
  • HeroUI AlertDialog

    HeroUI AlertDialog

    80

More in Buttons

View all
  • Button

    Button

    14
  • Button

    Button

    34
  • Texture Button

    Texture Button

    92
  • Button Save

    Button Save

    46
  • Button

    Button

    64
  • Button Group

    Button Group

    3
  • App Store Button

    App Store Button

    454
  • Notification Button

    Notification Button

    103