Skip to content
SENVENLI UI

Select

Pick one option from a short list in a dropdown, with groups, descriptions and icons.
A short list
import { Select } from "@senvenli/react/selection";

Examples

Groups, descriptions and details

Options under headers, with a second line and a right-aligned detail.

Compact

The 32px size for table filters and toolbars, named by aria-label.

Invalid and disabled

An error under the field, and a field that cannot change.

Several: A few options

Each choice shows as a tag that can be removed.

Several: Select all, with collapsed tags

A footer selects everything; tags past the limit fold into a count.

Several: Invalid and disabled

The app's own error under the field, and a field that cannot change.

Guidelines

When to use it

  • One choice from about 5 to 15 options.
  • Several choices from a medium list.

Use something else when

  • Fewer than 5 options should all stay visible. Radio group
  • The list is long and people type to find. Combo box
  • A few options should all stay visible. Checkbox
  • The options should stay visible on the page, not in a dropdown. List box

Accessibility

Keyboard

KeysWhat happens
Space, Enter, Arrow downOpens the list.
Arrow keys, typingMoves to an option.

Built in

  • Announced as a button that opens a listbox.
  • Required fields show "Fill in this field." after a blur or a submit; your own errorMessage replaces it.
  • Each tag has a remove button named after its option.

You provide

  • A visible label.

API reference

Select

label
React.ReactNode

The label sits above the field.

itemsRequired
readonly SelectItem[]

Up to ~15 options; more, or options people know by name → ComboBox.

selectedKey
Key

Controlled value; null is "nothing chosen". It may start undefined and become set later.

defaultSelectedKey
Key
onSelectionChange
(key: Key | null) => void | (keys: Key[]) => void
placeholder
string

Defaults to "Select" in the provider locale.

description
React.ReactNode
errorMessage
React.ReactNode
isInvalid
boolean
aria-invalid
boolean | "true" | "false"

Set by a form row that owns the error text (the shared Field hands its control aria-invalid): the field shows its invalid state as with isInvalid, and without an errorMessage of its own draws no error row, so the row's message is the only one. The trigger is a button, on which React Aria sets no aria-invalid: the forwarded invalid state shows as data-invalid on the field (its danger border) and through the row's own error text, not as aria-invalid on the trigger. It marks the field invalid for styling and assistive tech only: unlike isInvalid it never becomes the field's native validity (React Aria's default outside a DS Form), so it never blocks a form's submit.

isRequired
boolean
requiredValidation
RequiredValidation

Who says an empty required Select is missing: field (default) shows "Fill in this field." on blur and on a DS Form submit, which it then blocks; app only marks the field (*, aria-required) and the app shows its own error. See {@link RequiredValidation}. The app's isInvalid (true with its errorMessage, or false) overrides the check, as on TextField. Disabled, empty and required, it still blocks a DS Form's submit and cannot take focus (as TextField).

isDisabled
boolean
size
FieldSize

compact (32px) for table filters and toolbars.

name
string
selectionMode
"single" | "multiple"

single (default): one choice from a known list.

radius
ComponentRadius

Corner radius: none, small, medium (the design), large or full. The provider's default otherwise.

aria-label
string

Names the field for assistive technology when no visible label is shown.

selectedKeys
readonly Key[]

Controlled; may start undefined and become set later (never flips control).

defaultSelectedKeys
readonly Key[]
maxVisibleTags
number

Tags shown before the rest collapse into "+3".

allowsSelectAll
boolean

Adds the "Select all" footer with the selected count.