Skip to content
Components / Controls

Native select

The browser's own select, styled, for long lists and forms that must work without JavaScript.

@fabrials/ui
Loading state

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { NativeSelect, NativeSelectOption, NativeSelectOptGroup, NativeCheckbox } from "@fabrials/ui";
  2. Or install it under shadcn's name, so code that imports @/components/ui/native-select gets this control. See shims.

    npx shadcn@latest add @fabrials/native-select

API reference

Prop / exportTypeDescription
name / defaultValuestringSubmitted with the form.
childrenNativeSelectOption | NativeSelectOptGroupOptions, optionally grouped.
NativeCheckbox indeterminatebooleanThe mixed state of a select-all. It is applied as the element's property and re-applied after every render and change.
NativeCheckbox labelReactNodePuts the box in a whole-row label, a 44px target.

Behavior

Keeps the platform picker on phones. NativeCheckbox is the matching native checkbox; NativeRadio and NativeRadioGroup are the radios.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.