Select

Select controls choose one option from a compact set such as status, owner, or view mode.

Overview and decision boundary

Use Select when a user chooses one option from a compact, known set.

Do not use Select for large, searchable, async, or remotely loaded datasets; use a future Combobox.

Preview

Status

Choose the closest workflow state.

Disabled select
import { Select } from '@nerio-ui/ui/client';<Select  label="Publication status"  name="status"  placeholder="Choose status"  options={[    { label: 'Draft', value: 'draft' },    { label: 'In review', value: 'review' },    { label: 'Published', value: 'published' },    { label: 'Archived', value: 'archived', disabled: true },  ]}/>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add selectimport { Select } from '@nerio-ui/ui/client';

Usage

import { Select } from '@nerio-ui/ui/client';<Select  label="Publication status"  name="status"  placeholder="Choose status"  options={[    { label: 'Draft', value: 'draft' },    { label: 'In review', value: 'review' },    { label: 'Published', value: 'published' },    { label: 'Archived', value: 'archived', disabled: true },  ]}/>

Variants

ModePurpose
optionsData-driven options for a compact known list.
composedCurated items, groups, labels, and separators.
sm / md / lgShared control scale; md is the default.

Anatomy

SlotPurpose
rootRoot slot exposed through data-slot="root".
labelLabel slot exposed through data-slot="label".
triggerButton-like control that opens the option list.
valueCurrent selection or placeholder text.
iconChevron end-slot centered within the trigger.
contentLayered list rendered through Base UI portal behavior.
itemSelectable option with highlighted and selected states.
item-descriptionOptional supporting text for an option.
indicatorSelected-item indicator.
group / group-labelCurated grouping anatomy for structured option sets.
separatorVisual boundary between option groups.
messageHelper or validation message.

States

StateBehavior
OpenOptions appear above the app layer.
PlaceholderPlaceholder text does not auto-select the first option.
HighlightedKeyboard or pointer focus indicates the next selection.
SelectedA restrained selected surface and indicator confirms the current value.
DisabledPrevents choosing unavailable options.
Read-onlyKeeps the value visible without allowing changes.
RequiredSupports native form required metadata.
InvalidConnects error text and aria-invalid when validation fails.

Motion

  • State changes should use shared motion tokens and preserve reduced-motion behavior.

Accessibility

  • Uses the Base UI Select primitive.
  • The visible label is associated with the select control.
  • Supports placeholder, description, helper or error message, disabled, read-only, and invalid states.
  • Supports native form metadata including name, form, required, readOnly, and autoComplete.
  • Does not select the first option when only a placeholder is supplied.
  • Error messages are announced with role="alert" only when invalid is true.
  • Options support disabled states, typeahead, and Base UI keyboard navigation.
  • Large, filterable, remotely loaded, and multi-select datasets belong to a future Combobox.

API

PropsPurpose
label / optionsVisible ReactNode label and concise data-driven options.
childrenCurated SelectItem composition; cannot be mixed with options.
value / defaultValue / onValueChangeControlled or uncontrolled single value with Base UI event details.
open / defaultOpen / onOpenChangeControlled or uncontrolled popup state with Base UI event details.
size / triggerRefShared control size and access to the combobox trigger.
name / form / required / readOnly / autoCompleteNative form participation and control state.
classNameExtends the component root while preserving tokenized defaults.

Implementation contract

ContractValue
Registry itemselect installs Tailwind-first source, the token bridge, and residual popup keyframes.
Base UIselect
Registry dependenciesform-message
Package dependencies@base-ui/react, @nerio-ui/adapters, clsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Select when a user chooses one option from a compact, known set.

Do / do not

Do

Use for status, owner, view mode, and compact configuration choices.

Do not

Use Select for large, searchable, remotely loaded, or multi-select datasets.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-select-height-smPublic customization point for this component contract.
--n-select-height-mdPublic customization point for this component contract.
--n-select-height-lgPublic customization point for this component contract.
--n-select-padding-inlinePublic customization point for this component contract.
--n-select-trigger-gapPublic customization point for this component contract.
--n-select-item-gapPublic customization point for this component contract.
--n-select-item-padding-inlinePublic customization point for this component contract.
--n-select-group-label-padding-inlinePublic customization point for this component contract.
--n-select-empty-paddingPublic customization point for this component contract.
--n-select-popup-radiusPublic customization point for this component contract.
--n-input-radiusPublic customization point for this component contract.
--n-input-backgroundPublic customization point for this component contract.
--n-input-borderPublic customization point for this component contract.
--n-input-border-hoverPublic customization point for this component contract.
--n-input-border-focusPublic customization point for this component contract.
--n-input-border-dangerPublic customization point for this component contract.
--n-input-placeholderPublic customization point for this component contract.
--n-input-foregroundPublic customization point for this component contract.
--n-input-disabled-backgroundPublic customization point for this component contract.
--n-input-disabled-foregroundPublic customization point for this component contract.
--n-overlay-z-indexPublic customization point for this component contract.
--n-overlay-backgroundPublic customization point for this component contract.
--n-overlay-borderPublic customization point for this component contract.
--n-overlay-shadowPublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.