Skip to content
satin

Select

Picks one value from a list, with a label, a hint and an error like any field.

Everyone on the project sees it.

Installation

Terminal
npm i @uisatin/ui
Import
import { Select } from '@uisatin/ui/select'

About 46.5 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.

First time with Satin? Set it up once, styles and fonts included, with the installation guide.

API Reference

The Select component wraps the Radix select in a div with a label, a trigger button and a hint. Its list is the Dropdown menu, so each option takes an icon, a description and a shortcut, in groups or not.

PropTypeDefault
options
SelectOption[]SelectGroup[]
—
value
string
—
defaultValue
string
—
onValueChange
(value: string) => void
—
label
ReactNode
—
hint
ReactNode
—
error
ReactNodeboolean
—
leadingIcon
ReactNode
—
size
"sm""md""lg"
"md"
layout
"inline""stacked"
"inline"
iconSize
1620
16
placeholder
string
—
disabled
boolean
false
name
string
—
required
boolean
false
open
boolean
—
defaultOpen
boolean
false
onOpenChange
(open: boolean) => void
—
menuAlign
"start""end"
"start"
className
string
—
ref
Ref<HTMLElement>
—
...props
ComponentProps<typeof Select.Trigger>

Other attributes go to the Radix Select.Trigger part

—

Accessibility

A Radix select. The trigger is a button with role="combobox", aria-expanded and aria-controls, named by label (or aria-label) and described by the hint or error (aria-describedby, aria-invalid). The list is a listbox of options, with group labels; the current one shows a check and adds "(selected)" for screen readers. Closing returns focus to the trigger. Inside a form, a hidden native select carries the value.

KeyAction
EnterorSpaceor↑or↓On the trigger: opens the list on the current option.
A–ZOn the closed trigger: picks the next option whose label starts with the typed letters. In the list: moves to it.
↑or↓Moves between options.
HomeorEndMoves to the first or last option.
EnterorSpacePicks the focused option and closes the list.
EscCloses the list without picking.