Skip to content
Forms

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

PropTypeDefault
value bindable
string''
options

Pass options, or supply `<option>` elements as children.

SelectOption[]—
placeholder
string—
size
'sm' | 'md' | 'lg''md'
invalid
booleanfalse
class
string—

Anything else is forwarded to the underlying element, typed as HTMLSelectAttributes.

Snippets of Select

SnippetTypeDefault
children
Snippet—

See also

cock. Yes, it stands for core component kit. We checked twice.