Skip to content

Components · Forms

Select

Single-value picker with typeahead and keyboard navigation.

@rookcom/monarch-reactComponent

Status picker

Usage examples

The example at the top of the page is the only one for this component.

Purpose

Picks one value from a short, known list. Built on Radix Select, which provides typeahead, arrow-key navigation and screen-reader semantics.

Use when

  • The list is short enough to scan without searching (statuses, priorities, roles).

Avoid when

  • The list is long or needs searching: use Combobox.
  • There are two to five options that should all be visible: a segmented control (planned) or radio choices.

Design principles

  • The trigger looks like an Input (.mn-input), so forms read as one family.
  • Menu items share the .mn-menu styles with DropdownMenu and Combobox.

API reference

import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from '@rookcom/monarch-react';
ExportKindRenderingRoot class
Selectcomponentclient.mn-input
SelectContentcomponentclient.mn-input
SelectGroupcomponentclient.mn-input
SelectItemcomponentclient.mn-input
SelectLabelcomponentclient.mn-input
SelectSeparatorcomponentclient.mn-input
SelectTriggercomponentclient.mn-input
SelectValuecomponentclient.mn-input

Select, SelectGroup and SelectValue are the Radix primitives re-exported unchanged.

SelectTrigger, SelectContent, SelectItem, SelectLabel and SelectSeparator forward their refs to the Radix parts.

SelectContent renders in a portal with position="popper" and sideOffset={4} by default.

Generated from the TypeScript declarations of packages/react/src/components/forms/select.

Properties

Select

Single-value select built on Radix Select: typeahead, arrow-key navigation, and screen-reader semantics come from the primitive. <Select value={v} onValueChange={setV}> <SelectTrigger placeholder="Choose a status" /> <SelectContent> <SelectItem value="open">Open</SelectItem> </SelectContent> </Select>

PropTypeDescription
childrenReact.ReactNode
disabledboolean

SelectContent

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
idstring

SelectGroup

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
idstring

SelectItem

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
disabledboolean
idstring

SelectLabel

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
idstring

SelectSeparator

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
idstring

SelectTrigger

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
disabledboolean
idstring
invalidboolean
placeholderstring
size"sm" | "md" | "lg"

SelectValue

PropTypeDescription
asChildboolean
childrenReactNode
classNamestring
idstring

Variants

PropValuesDescription
size (SelectTrigger)'sm''md''lg'Trigger height, matching Input sizes. Default md. Exposed as data-size.

States

StateExposed asBehaviour
Placeholderdata-placeholderThe placeholder text shows in the subtle text colour until a value is chosen.
Invalidaria-invalid="true"Danger border, from invalid or the surrounding Field.
Highlighted itemdata-highlightedThe item under the pointer or keyboard focus; the selected item shows a check.

Interaction behaviour

  • Clicking the trigger opens the list; choosing an item closes it and calls onValueChange.
  • The selected item is marked with a check indicator.

Keyboard support

This section is incomplete

Keyboard handling comes from Radix Select and is not covered by Monarch tests yet.

Radix Select provides typeahead and arrow-key navigation.

Accessibility

Role
combobox (trigger) with a listbox of options
Accessible name
A FieldLabel in the surrounding Field, or aria-label on SelectTrigger.
  • Inside a required Field the trigger gets aria-required, not required (invalid on a button).
  • Inside an invalid Field the trigger gets aria-invalid.

Responsive behaviour

This section is incomplete

No responsive behaviour is defined; the content is positioned by Radix.

Theme support

  • Trigger and menu colours are semantic tokens, so every theme applies automatically.

Do and don't

Do

  • Give the trigger a label through Field or aria-label.

Don't

  • Do not use Select for long lists that need searching; use Combobox.

Dependencies

KindDepends on
npm packages@radix-ui/react-selectreact
Monarch componentsField

Testing coverage

  • Trigger inside an invalid required Field gets aria-invalid and aria-required, not required.
  • A labelled trigger renders without axe violations.
CheckCovered
Axe in jsdomYes
Server renderingYes
Browser suitesVisual baselines: /__gallery; Cross-browser axe: /components/select

Tests: packages/react/src/components/forms/select