Select
Choose the team this project belongs to.
Choose the team this project belongs to.
A labeled native dropdown for choosing one option; pair value with onValueChange.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For one choice from a list of about five to fifteen known options.
Two to four options? Choice shows them all at once. A long list people search? Combobox.
A native select, so every platform’s own keyboard and screen reader support comes with it.
import { Select } from '@idyeah/diya'Stable since 1.0.0
labelRequiredstringVisible label above the select; also its accessible name. Hide it with hideLabel.
optionsRequiredSelectOption[]The choices, in display order.
defaultValuestringThe initially chosen value when uncontrolled; defaults to '' (the placeholder), and a form reset returns to it.
errorstringVisible error message below the select; marks the field invalid while set.
helperTextstringVisible hint below the select, announced with it; error replaces it while set.
hideLabelbooleanHides the label visually but keeps it as the select's accessible name.
Default false
leadingIconReactNodeDecorative icon inside the select's start edge; hidden from assistive tech.
onValueChange(value: string) => voidCalled with the chosen option's value, like every other DIYA field. The native onChange still works.
placeholderstringVisible text of the empty, unselectable first option, shown while value is ''; defaults to the select.placeholder message.
size"small" | "medium" | "large"Control height and type size; defaults to 'medium'.
Default 'medium'
valuestringThe chosen option's value, or '' for none, when controlled; pair it with onValueChange.
Also takes every native <select> attribute, such as name, id or data-*.