Select
The native select, styled, with an options array or your own markup.
import
import { Select } from '@joshicodes/cock';Options
Pass an options array, or supply your own <option> elements as children.
Behaviour
- A real `<select>`, so the phone opens its own picker and the keyboard behaviour is the platform one.
API
Read out of the component sources at build time, so it matches the version you installed.
Every component also takes class, merged
through tailwind-merge so your utility wins.
Props of Select
| Prop | Type | Default |
|---|---|---|
value bindable | string | '' |
options Pass options, or supply `<option>` elements as children. | SelectOption[] | — |
placeholder | string | — |
size | 'sm' | 'md' | 'lg' | 'md' |
invalid | boolean | false |
class | string | — |
Anything else is forwarded to the underlying element, typed as HTMLSelectAttributes.
Snippets of Select
| Snippet | Type | Default |
|---|---|---|
children | Snippet | — |