Native Select
The browser's own select, styled like the kit's fields. Phones open their own picker.
Installation
pnpm add @heyramzi/uiUsage
import * as NativeSelect from "@heyramzi/ui/shadcn/native-select";<NativeSelect.Root bind:value={status} aria-label="Status">
<NativeSelect.Option value="todo">To do</NativeSelect.Option>
<NativeSelect.Option value="done">Done</NativeSelect.Option>
</NativeSelect.Root>API reference
NativeSelect.Root
size"sm" | "default"- Default
"default" refbindableHTMLSelectElement | null- Default
null valuebindableHTMLSelectAttributesclassstringchildrenSnippet...rest- Every prop of
HTMLSelectAttributesfromsvelte/elementsexceptsize
| Prop | Type | Default |
|---|---|---|
size | "sm" | "default" | "default" |
ref bindable | HTMLSelectElement | null | null |
value bindable | HTMLSelectAttributes | |
class | string | |
children | Snippet | |
...rest | Every prop of HTMLSelectAttributes from svelte/elements except size | |
NativeSelect.Option
refbindableHTMLOptionElement | null- Default
null classstringchildrenSnippet...rest- Every prop of
HTMLOptionAttributesfromsvelte/elements
| Prop | Type | Default |
|---|---|---|
ref bindable | HTMLOptionElement | null | null |
class | string | |
children | Snippet | |
...rest | Every prop of HTMLOptionAttributes from svelte/elements | |
NativeSelect.OptGroup
refbindableHTMLOptgroupElement | null- Default
null classstringchildrenSnippet...rest- Every prop of
HTMLOptgroupAttributesfromsvelte/elements
| Prop | Type | Default |
|---|---|---|
ref bindable | HTMLOptgroupElement | null | null |
class | string | |
children | Snippet | |
...rest | Every prop of HTMLOptgroupAttributes from svelte/elements | |