NativeSelect
Loading example…
Styled native <select> (keeps the system picker on touch devices). It extends the existing
Select styling with a data-driven options API, optgroups, a placeholder and a compact size.
Import
Section titled “Import”import { NativeSelect } from "@jcsoftdev/ui/forms";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/forms/native-select.
<NativeSelect options={options} placeholder="Elige un barbero" aria-label="Barbero"/>| Prop | Type | Default | Description |
|---|---|---|---|
options |
(NativeSelectOption | NativeSelectGroup)[] |
Data-driven alternative to <option> children; groups render as <optgroup>. |
|
placeholder |
string |
Disabled first option shown while nothing is chosen. | |
size |
"sm" | "md" |
"md" |
|
invalid |
boolean |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/forms/native-select/native-select.tsx