Skip to main content
v7

Dropdown

A floating panel triggered by a button, with focus management, keyboard dismissal and optional hover opening.

Package@g4rcez/componentsSectionFloating Elements

Examples

Basic Dropdown

Click the trigger to open a floating panel with a title and content.

Basic

Confirmation panel

A title, a short muted paragraph and one action. The border is a soft hairline and the shadow lifts the panel off the page.

Review

Hover Trigger

Pass hover to open the dropdown on mouse enter instead of click.

Hover

Controlled Open State

Control open externally via the open and onChange props.

Controlled

Placement

Use side and align to choose where the panel opens. offset sets the gap in pixels.

Placement

Without a title

Without title the panel has no header, so pass aria-label. className sets the panel width and layout (w-72, w-auto). The design system CSS has no @layer, so it wins over utility classes: set the panel padding and radius with --var-dropdown-surface-padding and --var-dropdown-surface-radius, not with p-* or rounded-*. initialFocus picks the element that receives focus.

Search panel

When to use Dropdown

Use when

You need the documented Dropdown interaction or presentation in a product workflow.

Avoid when

A native HTML element already provides the Dropdown behavior you need.

Accessibility

Keep the Dropdown labeled and use its documented keyboard interaction. The component preserves visible focus and communicates state without relying on color alone.