Murasaki
Components

Select

Displays a list of options for the user to pick from—triggered by a button.

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@murasakijs/ui";
<Select>
  <SelectTrigger className="w-[180px]">
    <SelectValue placeholder="Select a fruit" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="apple">Apple</SelectItem>
  </SelectContent>
</Select>

API Reference

Subcomponents

ComponentDescription
SelectThe root primitive. Accepts value, defaultValue, onValueChange, disabled, name, required.
SelectGroupGroups related SelectItems together.
SelectValueDisplays the selected value, or placeholder when empty.
SelectTriggerThe button that opens the popup.
SelectContentThe popup itself. Accepts position ("item-aligned" | "popper", default "popper").
SelectLabelA non-interactive label inside SelectContent/SelectGroup.
SelectItemA selectable option. Accepts value (required) and disabled.
SelectSeparatorA visual divider between items or groups.
SelectScrollUpButton / SelectScrollDownButtonScroll affordances rendered automatically inside SelectContent.

Selection state, typeahead, keyboard navigation, and overlay positioning are provided by React Aria Components.

Improve this page on GitHub

On this page