Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

Select

  • Needs review
  • WCAG 2.2 evidence
  • RTL
  • Web · iOS · Android

Picks one or several values from a list. Built on React Aria Select + Button + SelectValue + Popover + ListBox: the label, helper and error text are linked to the trigger; Enter, Space and the arrow keys open the list with focus on the selected (or first) option; arrows, Home/End and type-ahead move; Enter, Space or a click selects; Escape closes and returns focus to the trigger (WCAG 2.1.1, 2.4.3, 4.1.2). Errors show as text with an icon under the field, never by colour alone (1.4.1, 3.3.1). A hidden native <select> carries the value in form submissions (name) and native validation (isRequired). selectionMode="multiple" keeps the list open while picking and shows the values as removable SelectTags in the field. Use Radio group or Segmented control for fewer than four options and Combobox for long lists that need search. Consumer duties: label and option wording; error text that says how to fix the problem.

import { Select } from "@nexera-ui/react";
Loading example…
11
examples
39
props
7
live controls
3
platforms
14
WCAG criteria
14
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
description
size
platform
isDisabled
isRequired
isInvalid
placeholder
Generated code
import { Select } from "@nexera-ui/react";

<Select />

Examples 10

The same examples as Storybook, rendered live. Open Code to copy one.

Sizes

Every Figma Size (32, 40 and 48 px), with the optional leading icon.

Loading example…

States

Semantic states: Filled (defaultValue), Disabled (isDisabled) and Error (isInvalid + errorMessage).

Loading example…

Open list

The list open: as wide as the trigger, groups with SelectGroupLabel, descriptions, leading icons and a disabled option. The selected option shows a check mark. Escape closes it and returns focus to the trigger.

Loading example…

Multiple selection

selectionMode="multiple": options show the Figma Multi checkbox, the list stays open while picking, and the values appear as removable SelectTags in the field (remove button, or Delete on a focused tag).

Loading example…

Controlled

Controlled value: value and onChange.

Loading example…

Platforms

Figma Select Mobile: platform="ios" (50 pt, up-down chevron) and platform="android" (52 dp), Body/Large, radius 12, 20 px icons; the options use Select option Mobile rows (44 pt / 48 dp).

Loading example…

Long label

Long labels, helper texts and values wrap.

Loading example…

Right to left

Right-to-left: label, icons, padding and the list mirror (logical properties); the list follows the direction.

Loading example…

Composition

Composable parts: SelectRoot + FieldLabel + SelectTrigger + SelectPopover, with a dynamic collection.

Loading example…

Dependent locations

Loading example…

Props 39

Press "Try it" on a card to load that prop into the playground.

39 props shown

children*Nexera
ReactNode | ((item: T) => ReactNode)

The options: SelectOption elements (optionally grouped in SelectSection with a SelectGroupLabel), or a function that renders one option per item of items.

Default –
itemsNexera
Iterable<T>

Item objects for a dynamic collection; children must then be a function.

Default –
descriptionNexera
ReactNode

Helper text under the trigger. Linked with aria-describedby. Replaced by the error message while the field is invalid, as in the Figma Error state.

Default –
errorMessageNexera
ReactNode | ((validation: ValidationResult) => ReactNode)

Error text under the trigger, shown with an error icon while the field is invalid (isInvalid, or a failed isRequired / validate check on submit) and linked with aria-describedby. Defaults to the validation message. Say what is wrong and how to fix it.

Default –
leadingIconNexera
ReactNode

Icon before the value. Decorative.

Default –
renderEmptyStateNexera
((props: ListBoxRenderProps) => ReactNode)

Content shown in the list when it has no options; the list only opens empty with allowsEmptyCollection.

Default –
selectedTagsLabelNexera
string

Accessible name of the selected tags of a multi-select without a visible label. Translate it for your locale.

Default Selected options
classNameNexera
string

Extra classes for the field (label, trigger, helper text), merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style for the field.

Default –
sizeNexera
"sm" | "md" | "lg"

Height, padding and type of the trigger: 32 / 40 / 48 px with Body/Small, Body/Default and Body/Large on web. Select Mobile has one size: 50 pt on iOS and 52 dp on Android with Body/Large, whatever size.

Default "sm"
platformNexera
"web" | "ios" | "android"

Platform look. Defaults to the NexeraProvider platform. The trigger, the list and its options follow it.

Default "web"
labelNexera
FieldLabelContent

Visible label, linked to the control by React Aria (WCAG 1.3.1, 3.3.2). Short noun, for example "Work email". Wraps instead of truncating. A placeholder is never a substitute for it. Not set: the field has no visible label. Not set: the field has no visible label of its own.

Default –
aria-labelNexera
string

Accessible name when it must differ from the visible label. Prefer the visible label (WCAG 2.5.3). Accessible name. Required when there is no visible label; translate it. Accessible name. Optional when aria-labelledby is set.

Default –
aria-labelledbyNexera
string

Id(s) of element(s) that name the field; wins over the visible label. Id(s) of element(s) that name the field; wins over aria-label. Id(s) of visible element(s) that name the field.

Default –
isDisabledReact Aria
boolean

Whether the input is disabled.

Default –
autoFocusReact Aria
boolean

Whether the element should receive focus on render.

Default –
formReact Aria
string

The <form> element to associate the input with. The value of this attribute must be the id of a <form> in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).

Default –
nameReact Aria
string

The name of the input, used when submitting an HTML form.

Default –
valueReact Aria
Key | readonly Key[] | null

The current value (controlled).

Default –
idReact Aria
string

The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –
validationBehaviorReact Aria
"native" | "aria"

Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.

Default 'native'
autoCompleteReact Aria
string

Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).

Default –
selectionModeReact Aria
"single" | "multiple"

Whether single or multiple selection is enabled.

Default 'single'
selectedKeyReact Aria
Key | null

The currently selected key in the collection (controlled). @deprecated

Default –
defaultSelectedKeyReact Aria
Key | null

The initial selected key in the collection (uncontrolled). @deprecated

Default –
onSelectionChangeReact Aria
(key: Key | null) => void

Handler that is called when the selection changes. @deprecated

Default –
isOpenReact Aria
boolean

Sets the open state of the menu.

Default –
defaultOpenReact Aria
boolean

Sets the default open state of the menu.

Default –
onOpenChangeReact Aria
(isOpen: boolean) => void

Method that is called when the open state of the menu changes.

Default –
shouldCloseOnSelectReact Aria
boolean

Whether the Select should close when an item is selected. Defaults to true if selectionMode is single, false otherwise.

Default –
allowsEmptyCollectionReact Aria
boolean

Whether the select should be allowed to be open when the collection is empty.

Default –
disabledKeysReact Aria
Iterable<Key>

The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.

Default –
defaultValueReact Aria
Key | readonly Key[] | null

The default value (uncontrolled).

Default –
onChangeReact Aria
(value: ChangeValueType<M>) => void

Handler that is called when the value changes.

Default –
isRequiredReact Aria
boolean

Whether user input is required on the input before form submission.

Default –
isInvalidReact Aria
boolean

Whether the input value is invalid.

Default –
validateReact Aria
(value: ValidationType<M>) => true | ValidationError | null

A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if validationBehavior="native". For realtime validation, use the isInvalid prop instead.

Default –
placeholderReact Aria
string

Temporary text that occupies the select when it is empty.

Default 'Select an item' (localized)

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

7 direct · 7 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.4Resize TextLevel AA · supporting test
  • 1.4.10ReflowLevel AA · supporting test
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.3Focus OrderLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 3.3.1Error IdentificationLevel A · tested directly
  • 3.3.2Labels or InstructionsLevel A · tested directly
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-disabled
  • data-open
  • data-placeholder
  • data-pressed
Usage
<Select className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components