v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

Select

A styled native select that preserves familiar keyboard, mobile picker and form behavior.

Interactive preview

Selected: Orbit workspace

Usage

import { Select, Label } from "@devvy-ui/react";

<Label htmlFor="project">Project</Label>
<Select id="project" name="project" defaultValue="orbit">
  <option value="orbit">Orbit</option>
  <option value="studio">Studio</option>
</Select>

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
controlSizesm | md | lgmdVisual size; native numeric size is preserved.
variantoutline | filledoutlineBackground treatment.
value / defaultValuestring | number | readonly string[]—Controlled or initial selection. Use arrays with multiple.
multiple / sizeboolean / numberfalse / native defaultNative listbox and visible option count.
disabled / required / aria-invalidnative attributes—Native disabled, validation and error semantics.

Accessibility & behavior

Platform Behavior & Guidelines

Label the select visibly. Compose option and optgroup children; the browser owns the popup. Use aria-describedby for help/error text. Supports native reset, form association, multiple, size, disabled options and forwarded HTMLSelectElement refs. className and style customize the select. This is a native picker, not a searchable combobox.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add select

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

Select.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.