NativeSelect
A real `<select>`, styled to sit beside `Input` and `SelectTrigger` without giving itself away.
Indistinguishable from Input and SelectTrigger
A real `<select>`, so the OS draws the panel — a wheel on mobile, an OS-themed list on desktop. That is the whole reason it exists beside `Select`, and the whole reason its closed surface is pinned to the other two: `h-10`, 6px corner, `border-hairline`, `bg-surface-sunken`, solid accent border on focus. Three controls, one field family.
Usage
import { NativeSelect, NativeSelectOptGroup, NativeSelectOption } from '@oceanic-hub/brand-system'<NativeSelect>
<NativeSelectOptGroup>
<NativeSelectOption>…</NativeSelectOption>
</NativeSelectOptGroup>
</NativeSelect>Composition
Use the following composition to build a NativeSelect:
NativeSelect
├── NativeSelectOptGroup ×2
│ └── NativeSelectOption ×3
└── NativeSelectOption ×3Reach for it for the short, boring list in a dense form — a stage, a locale, a page
size — where the platform's own picker (a wheel on mobile, the OS's own themed panel on desktop,
a working control with JavaScript off) is the right answer. For "a single-select over many
options" the composition grammar still routes to the Combobox recipe (Popover + Command);
this is for the other case.
Select, by contrast, is the Radix listbox this package owns and styles end to end, including
a check mark in the open panel. The two sit in the same form on purpose — reach for
NativeSelect when there is nothing to style inside the open state, Select when there is.
Invalid is a solid stuck border, and it is stated twice. aria-invalid on the control
paints it — that is the attribute assistive technology already reads — and a Field marked
data-invalid paints it too, so a surface that wires only one of the two still draws the line
(@OCE-1877). Neither is the whole message: FieldError carries the sentence, in ink beside a
stuck mark, because a border can say that something is wrong and never what. Field's page
shows the line drawn on every control at once.
RTL is not supported — recorded in pairings.json under direction: nothing in this
package has been laid out or measured right-to-left.
Sizes
default is h-10, matching Input and SelectTrigger so the three sit on one row without anybody measuring. sm is h-8 — the sm Button's height — for a dense filter row above a table, where a full-height field would out-weigh the data it filters. Two heights and no third: size here shadows the native size attribute, which would turn a <select> into a list box.
Disabled
disabled on NativeSelect itself, not on one option — the whole control goes inert and fades, exactly as Input and SelectTrigger do.
Fetching its options
loading swaps the chevron for a Spinner in the chevron's own slot — same 14px box, same offset, so nothing reflows when the state flips. It belongs to the primitive because the primitive owns that corner: a caller cannot put a mark there without re-deriving the offset, and every caller that re-derives it slightly differently gets a control that twitches. It does NOT disable the control, deliberately — a select whose current value is still valid stays operable while a longer list loads behind it, and a caller who wants it inert passes disabled as well. The announced half is aria-busy on the control; the spinner is hidden from assistive technology so the same fact is not stated twice.
API Reference
See the NativeSelect API page for every prop of every part, with types, defaults and the contract that pins them.