Component
Select
Render single-choice dropdowns for sorting, filtering, and view controls with mobile sheet behavior.
Interactive preview
Usage
Import the component entry and start with its smallest complete example.
Import
import { Select } from "@chitrank2050/monoline-ui/select"Basic usage
<Select
value={sort}
onChange={setSort}
options={[
{ value: "recent", label: "Most recent" },
{ value: "oldest", label: "Oldest first" },
{ value: "read", label: "Most read" },
{ value: "az", label: "Alphabetical" },
]}
>
<Select.Trigger>
<span className="flex items-baseline gap-2">
<Select.Label>Sort:</Select.Label>
<Select.Value />
</span>
</Select.Trigger>
<Select.Content side="bottom" align="start" />
</Select>Usage guidance
Choose the component for its interaction model and semantics before customizing its appearance.
Select fits a moderate option set and switches between a desktop popover and mobile sheet.
You need unsynchronized native form submission, multiple selection, or interactive content inside an option.
Select wires its trigger to a listbox, exposes options with aria-selected, and implements keyboard navigation, typeahead, focus management, and labeled trigger text.
This component needs browser JavaScript for state or browser APIs.
API reference
Props, slots, and callbacks available on this component.
Design tokens
Theme variables this component reads for color, spacing, and motion.
Implementation
The source used by the example above, including any state it needs.
import { Select } from "@chitrank2050/monoline-ui/select"
export function SortControl() {
const [sort, setSort] = useState("recent")
return (
<Select
value={sort}
onChange={setSort}
options={[
{ value: "recent", label: "Most recent" },
{ value: "oldest", label: "Oldest first" },
{ value: "read", label: "Most read" },
]}
sheetLabel="Sort by"
>
<Select.Trigger>
<span className="flex items-baseline gap-2">
<Select.Label>Sort:</Select.Label>
<Select.Value />
</span>
</Select.Trigger>
<Select.Content side="bottom" align="start" />
</Select>
)
}Related documentation
Compare related components or review the package and theme setup.