Skip to content
daisyBlazor

Dropdown

A CSS-only menu built on details/summary: the Activator opens a panel of menu items below it. Use Placement, Hover or Open to control it; for click-to-close menus with Blazor state, reach for Menu.
Actions.dropdown
Cover · <Dropdown>

Examples

Basic

Activator is the trigger, ChildContent holds the li items of the menu.

website/Examples/Actions/DropdownBasicExample.razor Source

Placement

Placement puts the panel on any side of the trigger, or aligns it to the End.

website/Examples/Actions/DropdownPlacementExample.razor Source

Hover

Hover="true" opens the panel on mouse-over, with no click.

website/Examples/Actions/DropdownHoverExample.razor Source

Open forces the panel open, and ContentClass styles it (here wider, with titles and icons).

website/Examples/Actions/DropdownOpenExample.razor Source

API

<Dropdown>

DaisyBlazor

Parameters

  • ActivatorClass string
    = null

    Extra CSS classes merged onto the <summary> trigger, e.g. "btn btn-primary" to make the trigger itself a styled button. Use this instead of a <Button> inside Activator: a button nested in a summary swallows the click and the dropdown never opens.

  • ContentClass string
    = null

    Extra CSS classes forwarded to the .dropdown-content wrapper.

  • Hover bool
    = false

    When true, adds .dropdown-hover so the panel opens on mouse-over (CSS only).

  • Open bool
    = false

    Forces the dropdown open via the HTML open attribute and .dropdown-open class.

  • Placement DropdownPlacement?
    = null

    Placement of the dropdown content relative to the trigger.

  • Class string
    = null

    Extra CSS classes merged onto the root .dropdown element.

  • Style string
    = null

    Inline CSS styles applied to the root .dropdown element.

Content

  • Activator RenderFragment

    The trigger element rendered inside the <summary> tag.

  • ChildContent RenderFragment

    The dropdown panel content (typically a <ul> menu list).

Something went wrong while running the docs. Reload