NativeSelect
A styled <select> element with a custom chevron icon, optional label, description, and error message. Because it uses a native select, it works without JavaScript and has excellent accessibility out of the box.
Basic
<NativeSelect
label="Choose a framework"
data={['Davaux', 'Hono', 'Elysia', 'Fastify']}
/>With option objects
<NativeSelect
label="Country"
data={[
{ value: 'us', label: 'United States' },
{ value: 'gb', label: 'United Kingdom' },
{ value: 'ca', label: 'Canada' },
{ value: 'au', label: 'Australia', disabled: true },
]}
/>With description and error
Choose the plan that fits your needs.
Please select an option.
<NativeSelect
label="Plan"
description="Choose the plan that fits your needs."
data={['Free', 'Pro', 'Enterprise']}
/>
<NativeSelect
label="Required field"
data={['Option A', 'Option B']}
withAsterisk
error="Please select an option."
/>Sizes
<NativeSelect size="xs" data={['Option A', 'Option B']} />
<NativeSelect size="sm" data={['Option A', 'Option B']} />
<NativeSelect size="md" data={['Option A', 'Option B']} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | (string|NativeSelectOption)[] | — | Options rendered as <option> elements (required) |
id | string | — | Associates label with select via HTML for/id |
label | ReactNode | — | Label rendered above the select |
description | ReactNode | — | Helper text below the label |
error | ReactNode|boolean | — | Error message; pass true for styles only |
required | boolean | — | Marks field as required and adds asterisk |
withAsterisk | boolean | — | Adds asterisk without native required attribute |
disabled | boolean | — | Disables the select |
size | 'xs'|'sm'|'md'|'lg'|'xl' | — | Font size and height via design tokens |
radius | 'xs'|'sm'|'md'|'lg'|'xl'|string | — | Border-radius of the select |
value | string | — | Pre-selects the matching option (SSR snapshot) |
name | string | — | Form field name |
class | string | — | Additional CSS class names |
style | object | — | Inline styles |