Forms

Select.

The reliability of native selection.

Live preview

Live preview
Choose a color to preview its focus glow.
tsx
import { Select } from "luminescent";
import "luminescent/style.css";


export function Example() {
  return (
    <Select label="Workspace" defaultValue="personal" name="workspace">
      <option value="personal">Personal</option>
      <option value="team">Team</option>
    </Select>
  );
}

Installation

bash
npm install luminescent

Import luminescent/style.css once at your application root. The example above uses the same package implementation as Storybook.

Variants and states

Use the preview controls to explore the supported variants, sizes, disabled/loading states and reduced motion. Controls appear only where the component exposes the corresponding prop. Theme and glow apply to every component.

Controlled and uncontrolled state

State contract: value / defaultValue / onChange (native event). Omit the controlled prop to let the component own its initial state; supply a value and callback when your application owns it. Native uncontrolled fields and state-backed form controls participate in form reset. Controlled state must be reset by the application.

tsx
import { useState } from "react";
import { Select } from "luminescent";


export function ControlledExample() {
  const [value, setValue] = useState("personal");
  return (
    <Select
      label="Workspace"
      value={value}
      onChange={(event) => setValue(event.currentTarget.value)}
    >
      <option value="personal">Personal</option>
      <option value="team">Team</option>
    </Select>
  );
}

API reference

Generated from the source TypeScript interfaces. Native attributes, className, style, aria-* and data-* also pass through to the documented element. Import SelectProps from the package for the full inherited contract.

PropTypeDetails
labelstringOptional unless marked required.
descriptionstringOptional unless marked required.
errorstringOptional unless marked required.
size'sm' | 'md' | 'lg'Optional unless marked required.
glowColorGlowColorOptional unless marked required.
containerClassNamestringOptional unless marked required.

Accessibility and keyboard

Native select retains platform keyboard interactions and form validation. Labels, description and error are linked. Size chooses visual dimensions; multiple selection is not supported.

Keep labels meaningful and test application-level contrast, focus order and screen-reader output. See the accessibility guide for composition requirements.

Theme customization

tsx
import { LuminescentProvider, Select } from "luminescent";
import "luminescent/style.css";


export function Example() {
  return (
    <LuminescentProvider theme="light" accent="violet" glow="subtle">
      <Select label="Workspace" defaultValue="personal" name="workspace">
        <option value="personal">Personal</option>
        <option value="team">Team</option>
      </Select>
    </LuminescentProvider>
  );
}

Switch between light and dark in the preview, or open the playground for a larger workspace. Custom CSS variables can override spacing, color, typography and effects.

Related components