Skip to content
Status
Stable
Accessibility
Reviewed
Package
tenet-ui@0.5.0
Import
import { Select } from 'tenet-ui';

Also accepts every prop of Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'value' | 'defaultValue'>.

When to use: choosing one option from a known list. Select is a fully accessible listbox combobox (keyboard, typeahead, aria-activedescendant) — not a native <select>. Use it inside a FormControl.

  • Give it an accessible name via FormControl.Label or aria-label.
  • Pass choices as the options array ({ value, label, disabled? }); use placeholder for the unselected state.
  • Control it with value + onChange(value), or leave uncontrolled with defaultValue. For form submission, pass name (it emits a hidden input).
  • Use size / fullWidth from the scale (block is the deprecated 0.3.0 name and warns); use invalid for validation state.
  • Never build a div-based dropdown by hand — getting the ARIA listbox + keyboard right is exactly what this component does for you.
  • ✅ <Select options={[{ value: 'public', label: 'Public' }]} placeholder="Choose…" />
  • ✅ inside a form: <FormControl><FormControl.Label>Visibility</FormControl.Label><Select options={…} /></FormControl>
  • ❌ <div className="dropdown" onClick={…}> — not keyboard-accessible, no roles, no typeahead.

See also: Menu for actions, RadioGroup or SegmentedControl for a few visible options; system guideline forms.

3 stories for Select, open in Storybook

The full matrix (all args, controls, accessibility panel) is in Storybook.

PropTypeDefaultDescription
options *SelectOption[]NoneThe options to choose from.
valuestringNoneControlled selected value.
defaultValuestringNoneUncontrolled initial value.
onChange(value: string) => voidNoneCalled with the newly selected value.
placeholderstringSelect…Text shown when nothing is selected.
size'small' | 'medium' | 'large'
SelectSize
mediumControl height / font scale.
fullWidthbooleanNoneStretch to fill the available width.
blockdeprecatedbooleanNoneStretch to fill the available width.
Deprecated since 0.5.0. Use fullWidth instead (renamed in 0.4.0). block keeps working until 0.6.0.
invalidbooleanfalseInvalid state (danger border + aria-invalid).
disabledbooleanfalseDisable the control.
requiredbooleanfalseRequired (sets aria-required; pairs with FormControl).
namestringNoneForm field name — emits a hidden input so the value submits with a form.
idstringNoneId applied to the trigger (FormControl sets this automatically).
classNamestringNone
aria-labelstringNone
aria-describedbystringNone

* requiredDeprecated props keep working for one minor release; the replacement is named in the row.

SelectOption

MemberTypeDefaultDescription
value *stringNoneValue submitted / reported on change.
label *stringNoneVisible option text.
disabledbooleanNoneDisable this option.