Import
Usage
Components
SelectMenu
The default component that includes a label wrapper. Thechildren prop is rendered as the label text above the select menu.
SelectMenuRaw
A raw version without the label wrapper, useful when you need custom layout or already have a label.Props
Both components extend all standard HTML<select> element attributes and accept the following additional props:
Array of options to display in the dropdown menu. Each option has a
name (displayed label) and value (form value).Custom content to display in the dropdown button. Used when
customDropdown is true or when values is not provided.When true, displays the
dropdown prop content instead of the selected value name.Additional buttons or content to render at the bottom of the dropdown panel.
CSS class for the dropdown panel background.
CSS class for the option buttons inside the dropdown.
Disables the backdrop blur effect on the dropdown panel.
Prevents the dropdown from automatically closing when clicking outside.
Opens the dropdown on hover instead of click.
Controls the alignment of the dropdown panel relative to the button.
Additional CSS classes for the dropdown button.
Behavior
- Internally renders a hidden native
<select>element for form compatibility - When an option is clicked, the native select is updated and dispatches a
changeevent - The dropdown panel has a maximum height of
18rem(72) with scrolling - Smooth animations with motion-safe preferences respected
- Clicking outside the dropdown automatically closes it (unless
nocloseonclickis true) - The selected value persists and is displayed in the button
Examples
The SelectMenu maintains compatibility with native forms by using a hidden
<select> element. This ensures proper form submission and integration with form libraries.