Dropdown Menu

Displays a menu to the user — such as a set of actions or functions — triggered by a button.

This component uses newly available browser features

This component uses CSS Anchor Positioning which has only been widely supported since January 2026. If you're targeting older or less mainstream browsers then maybe this component isn't for you, yet.

Alternatively you can use Singlestage 0.4 which positions the component correctly but with limited flexibility for alignment, or roll your own using Singlestage CSS classes for consistent styling.

More Info

Basic

A basic dropdown menu with labels and separators.

Submenu

Use MenuSub to nest secondary actions.

Shortcuts

Add MenuShortcut to show keyboard hints.

Icons

Combine icons with labels for quick scanning.

Checkboxes

Dropdown menus can use Checkboxes.

Checkbox Icons

Icons can be added to checkbox items.

Radio Group

Dropdown menus can use RadioGroups.

Radio Icons

Icons can be added to radio items..

Destructive

Use the destructive variant for irreversible actions.

Avatar

An account switcher dropdown triggered by an avatar.

Complex

A richer example combining groups, icons, and submenus.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::*;

#[component]
pub fn DropdownMenuAnatomy() -> impl IntoView {
    view! {
        <DropdownMenu>
            <DropdownMenuTrigger>
                <Button />
            </DropdownMenuTrigger>
            <DropdownMenuContent>
                <DropdownMenuGroup>
                    <DropdownMenuLabel />
                    <DropdownMenuItem>
                        <DropdownMenuShortcut />
                    </DropdownMenuItem>
                </DropdownMenuGroup>
                <DropdownMenuSeparator />
                <DropdownMenuSub>
                    <DropdownMenuSubTrigger />
                    <DropdownMenuSubContent>
                        <DropdownMenuGroup>
                            <DropdownMenuCheckboxItem />
                            <DropdownMenuCheckboxItem />
                        </DropdownMenuGroup>
                        <DropdownMenuSeparator />
                        <DropdownMenuGroup>
                            <DropdownMenuRadioGroup>
                                <DropdownMenuRadioItem />
                                <DropdownMenuRadioItem />
                                <DropdownMenuRadioItem />
                            </DropdownMenuRadioGroup>
                        </DropdownMenuGroup>
                    </DropdownMenuSubContent>
                </DropdownMenuSub>
            </DropdownMenuContent>
        </DropdownMenu>
    }
}

API Reference

CheckboxItem

A checkbox item for popover menus.

Custom Attributes
NameTypeDefaultDescription
disabledboolfalse

Controls whether the item appears disabled or not.

dismissbooltrue

Toggle whether clicking this item dismisses the parent menu.

insetboolfalse

Set whether or not this element should display inset from its normal position.

variantString""

Set the display variant of the item. Accepted values: "destructive".

Implements global and li attributes.

DropdownMenu

Contains all the parts of a dropdown menu.

Custom Attributes
NameTypeDefaultDescription
modalboolfalse

Set whether or not this popover should be modal meaning it can't be light dismissed Use this along with the `open` signal for a manually managed popover

openboolfalse

Reactive signal that can remotely control the open state of the popover **but is not coupled to the actual open state of the popover** unless `modal` is set to `true`

Implements global attributes.

Label

Labels groups.

Custom Attributes
NameTypeDefaultDescription
invalidboolfalse

Set whether or not this element should display as invalid.

Implements global attributes.

MenuContent

The component that pops out when the dropdown menu is open.

Custom Attributes
NameTypeDefaultDescription
alignString"start"

Set how to align the popover. Accepted values are "start" | "center" | "end"

sideString"bottom"

Set which side the popover opens relative to the trigger. Accepted values are "top" | "right" | "bottom" | "left".

Implements global attributes.

MenuGroup

Contains multiple items.

Implements global attributes.

MenuItem

Contains a menu item.

Custom Attributes
NameTypeDefaultDescription
disabledboolfalse

Controls whether the item appears disabled or not.

dismissbooltrue

Toggle whether clicking this item dismisses the parent menu.

insetboolfalse

Set whether or not this element should display inset from its normal position.

variantString""

Set the display variant of the item. Accepted values are "destructive"

Implements global and li attributes.

MenuShortcut

Displays next to the item content and indicates keyboard shortcuts.

Implements global attributes.

MenuSub

Contains all the parts of a sub menu.

Implements global attributes.

MenuSubContent

The component that pops out when the sub trigger is triggered.

Implements global attributes.

MenuSubTrigger

Defines the area where a sub menu can be triggered.

Custom Attributes
NameTypeDefaultDescription
disabledboolfalse

Controls whether the item appears disabled or not.

insetboolfalse

Set whether or not this element should display inset from its normal position.

variantString""

Set the display variant of the item. Accepted values: "destructive".

Implements global and li attributes.

Trigger

Provides context to a Button that triggers a DropdownMenu.

Implements global attributes.

RadioItem

A radio item for popover menus.

Custom Attributes
NameTypeDefaultDescription
disabledboolfalse

Controls whether the item appears disabled or not.

dismissbooltrue

Toggle whether clicking this item dismisses the parent menu.

insetboolfalse

Set whether or not this element should display inset from its normal position.

variantString""

Set the display variant of the item. Accepted values: "destructive".

Implements global and li attributes.

Separator

Visually separates groups of menu items.

Implements global attributes.