Select Option
- Stable
- WCAG 2.2 evidence
- RTL
- Web · iOS · Android
One choice in a Select, Combobox or ComboboxListbox. Built on React Aria ListBoxItem: role option with aria-selected, named by its label and described by
its description; arrow keys, Home/End and type-ahead move focus, Enter and Space select, disabled options are skipped
(WCAG 2.1.1, 4.1.2). Keyboard focus shows an inset focus ring (2.4.7). The Figma Type (Single or Multi) follows the
list's selectionMode: a selected Single option shows a check mark, a Multi option a checkbox, so selection is never
shown by colour alone (1.4.1). Consumer duties: option wording; a textValue when label is not plain text.
import { SelectOption } from "@nexera-ui/react";- 4
- examples
- 25
- props
- 4
- live controls
- 3
- platforms
- 9
- WCAG criteria
- 15
- 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.
import { SelectOption } from "@nexera-ui/react";
<SelectOption />Examples 3
The same examples as Storybook, rendered live. Open Code to copy one.
Types
Figma Type: Single (check mark and brand/subtle row when selected) and Multi (checkbox), derived from the list's selectionMode; with the optional description and leading icon.
import { type ReactNode } from "react";
import { ListBox } from "react-aria-components";
import { SelectOption, cn } from "@nexera-ui/react";
import { LuBuilding2 } from "react-icons/lu";
function List({
label,
platform = "web",
selectionMode = "single",
defaultSelectedKeys = [],
children,
}: {
label: string;
platform?: Platform;
selectionMode?: "single" | "multiple";
defaultSelectedKeys?: string[];
children: ReactNode;
}) {
return (
<div data-platform={platform} className={cn(selectPopoverStyles(), "w-80 max-w-full")}>
<SelectPlatformContext.Provider value={platform}>
<ListBox
aria-label={label}
data-platform={platform}
selectionMode={selectionMode}
defaultSelectedKeys={defaultSelectedKeys}
className={selectListBoxStyles()}
>
{children}
</ListBox>
</SelectPlatformContext.Provider>
</div>
);
}
export function Types() {
return (
<div className="flex flex-wrap items-start gap-8">
{(["single", "multiple"] as const).map((selectionMode) => (
<List
key={selectionMode}
label={`Type ${selectionMode}`}
selectionMode={selectionMode}
defaultSelectedKeys={["eng"]}
>
<SelectOption
id="eng"
label="Engineering"
description="42 people"
leading={<LuBuilding2 />}
/>
<SelectOption id="design" label="Design" leading={<LuBuilding2 />} />
<SelectOption id="finance" label="Finance" isDisabled leading={<LuBuilding2 />} />
</List>
))}
</div>
);
}
Platforms
Figma Select option Mobile: iOS (no fill, brand text and check) and Android (brand/subtle row, radius 8).
import { type ReactNode } from "react";
import { ListBox } from "react-aria-components";
import { SelectOption, cn } from "@nexera-ui/react";
import { LuCalendarDays } from "react-icons/lu";
const platforms = ["web", "ios", "android"] as const;
function List({
label,
platform = "web",
selectionMode = "single",
defaultSelectedKeys = [],
children,
}: {
label: string;
platform?: Platform;
selectionMode?: "single" | "multiple";
defaultSelectedKeys?: string[];
children: ReactNode;
}) {
return (
<div data-platform={platform} className={cn(selectPopoverStyles(), "w-80 max-w-full")}>
<SelectPlatformContext.Provider value={platform}>
<ListBox
aria-label={label}
data-platform={platform}
selectionMode={selectionMode}
defaultSelectedKeys={defaultSelectedKeys}
className={selectListBoxStyles()}
>
{children}
</ListBox>
</SelectPlatformContext.Provider>
</div>
);
}
export function Platforms() {
return (
<div className="flex flex-wrap items-start gap-8">
{platforms.map((platform) => (
<List
key={platform}
label={`Leave type ${platform}`}
platform={platform}
defaultSelectedKeys={["annual"]}
>
<SelectOption
id="annual"
label="Annual leave"
description="12 days available"
leading={<LuCalendarDays />}
/>
<SelectOption id="sick" label="Sick leave" leading={<LuCalendarDays />} />
<SelectOption id="unpaid" label="Unpaid leave" isDisabled leading={<LuCalendarDays />} />
</List>
))}
</div>
);
}
Long label and rtl
Long labels and descriptions wrap instead of truncating; right-to-left mirrors the row.
import { type ReactNode } from "react";
import { ListBox } from "react-aria-components";
import { SelectOption, cn } from "@nexera-ui/react";
import { LuBuilding2 } from "react-icons/lu";
function List({
label,
platform = "web",
selectionMode = "single",
defaultSelectedKeys = [],
children,
}: {
label: string;
platform?: Platform;
selectionMode?: "single" | "multiple";
defaultSelectedKeys?: string[];
children: ReactNode;
}) {
return (
<div data-platform={platform} className={cn(selectPopoverStyles(), "w-80 max-w-full")}>
<SelectPlatformContext.Provider value={platform}>
<ListBox
aria-label={label}
data-platform={platform}
selectionMode={selectionMode}
defaultSelectedKeys={defaultSelectedKeys}
className={selectListBoxStyles()}
>
{children}
</ListBox>
</SelectPlatformContext.Provider>
</div>
);
}
export function LongLabelAndRtl() {
return (
<List label="Long" defaultSelectedKeys={["a"]}>
<SelectOption
id="a"
label="البحث والتطوير وضمان الجودة للمنصات المحمولة"
description="يشمل فرق نظام التصميم وإمكانية الوصول في ثلاثة مكاتب"
leading={<LuBuilding2 />}
/>
<SelectOption id="b" label="العمليات" />
</List>
);
}
Props 25
Press "Try it" on a card to load that prop into the playground.
25 props shown
label*NexeraReactNodeVisible label. It names the option, is shown in the trigger once selected and is what
type-ahead and filtering match. Wraps instead of truncating. When it is not a plain string, also pass textValue.
descriptionNexeraReactNodeSecondary line under the label. Linked with aria-describedby.
leadingNexeraReactNodeLeading visual. Icons are
sized to 16 px on web and 20 px on iOS and Android; an Avatar keeps its own size. Decorative: the label names the
option.
platformNexera"web" | "ios" | "android"Platform look. Defaults
to the platform of the enclosing Select or Combobox, then of the NexeraProvider.
classNameNexerastringExtra classes, merged last so they win over the defaults.
styleNexeraCSSPropertiesInline style.
idReact AriaKeyThe unique id of the item.
valueReact AriaTThe object value that this item represents. When using dynamic collections, this is set automatically.
textValueReact AriastringA string representation of the item's contents, used for features like typeahead.
aria-labelReact AriastringAn accessibility label for this item.
isDisabledReact AriabooleanWhether the item is disabled.
onActionReact Aria() => voidHandler that is called when a user performs an action on the item. The exact user event depends
on the collection's selectionBehavior prop and the interaction modality.
hrefReact AriastringA URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).
hrefLangReact AriastringHints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).
targetReact AriaHTMLAttributeAnchorTargetThe target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).
relReact AriastringThe relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
downloadReact Ariastring | booleanCauses the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).
pingReact AriastringA space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).
referrerPolicyReact Aria"" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).
routerOptionsReact ArianeverOptions for the configured client side router.
onPressReact Aria(e: PressEvent) => voidHandler that is called when the press is released over the target.
onPressStartReact Aria(e: PressEvent) => voidHandler that is called when a press interaction starts.
onPressEndReact Aria(e: PressEvent) => voidHandler that is called when a press interaction ends, either over the target or when the pointer leaves the target.
onPressChangeReact Aria(isPressed: boolean) => voidHandler that is called when the press state changes.
onPressUpReact Aria(e: PressEvent) => voidHandler that is called when a press is released over the target, regardless of whether it started on the target or not.
* 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
4 direct · 5 supporting- 1.3.1Info and RelationshipsLevel A · tested directly
- 1.4.1Use of ColorLevel A · tested directly
- 1.4.10ReflowLevel AA · supporting test
- 1.4.12Text SpacingLevel AA · supporting test
- 2.1.1KeyboardLevel A · tested directly
- 2.4.7Focus VisibleLevel AA · supporting test
- 2.4.11Focus Not Obscured (Minimum)Level AA · supporting test
- 2.5.8Target Size (Minimum)Level AA · supporting test
- 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.
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-disableddata-focuseddata-hovereddata-presseddata-selected
<SelectOption className="data-disabled:opacity-90 shadow-sm" />Used in blocks
- Onboarding stepsOnboarding
- Profile setupOnboarding
- Settings layoutApp shells and navigation
- Workspace switcherApp shells and navigation
- Budget varianceDashboards and analytics
- Skills comparisonDashboards and analytics
- Filters drawerLists, tables and records
- Contact formForms and data entry
- Add a personForms and data entry
- Multi-step formForms and data entry
- Address and phoneForms and data entry
- Date range pickerForms and data entry
- Search with suggestionsForms and data entry
- Team members and rolesSettings and preferences
- Leave requestScheduling and calendar
Related components
- CalendarDayOne day of a {@link CalendarMonth } grid, built on React Aria `CalendarCell`: a `gridcell` whose button is named by the full, localised date ("Wednesday, October 14, 2026"), with `aria-selected`, `aria-disabled` and the "today" and range descriptions read by screen readers (WCAG 1.3.1, 4.1.2).
- CalendarMonthA month calendar for picking a date or a date range: header with previous / next buttons and the localised month name, weekday row, and six weeks of `CalendarDay`s.
- CheckboxThe bare 18 px checkbox: one independent yes/no choice applied on submit, or a row selector in a table, list or tree.
- CheckboxCardA large checkbox option with an icon, a title and a description, for a few options that need explanation (notification channels, benefits).
- CheckboxFieldA checkbox with a label and optional helper text: the box (the same element as `Checkbox`) followed by the label and description, applied on submit.
- ColorInputA hex colour field with a swatch and a picker popover.
- ColorPickerPicks a colour.
- ColorTokenCardDocumentation card for one colour token: a 96 px colour sample with an "Aa" text sample, then the name, token path, hex value and contrast note as text.