Forms

Checkbox.

Small choices, beautifully clear.

Live preview

Live preview
tsx
import { Checkbox } from "luminescent";
import "luminescent/style.css";


export function Example() {
  return (
    <Checkbox
      label="Ambient lighting"
      description="Give your interface a little warmth."
      defaultChecked
      name="lighting"
    />
  );
}

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: checked / defaultChecked / 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 { Checkbox } from "luminescent";


export function ControlledExample() {
  const [value, setValue] = useState(false);
  return (
    <Checkbox
      label="Lighting"
      checked={value}
      onChange={(event) => setValue(event.currentTarget.checked)}
    />
  );
}

API reference

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

PropTypeDetails
labelReact.ReactNodeOptional unless marked required.
descriptionstringOptional unless marked required.
indeterminatebooleanOptional unless marked required.
size'sm' | 'md' | 'lg'Optional unless marked required.
glowColorGlowColorOptional unless marked required.

Accessibility and keyboard

Native checkbox supports Space, label activation, indeterminate state, required, name and form submission. React onChange receives the native input event.

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, Checkbox } from "luminescent";
import "luminescent/style.css";


export function Example() {
  return (
    <LuminescentProvider theme="light" accent="violet" glow="subtle">
      <Checkbox
        label="Ambient lighting"
        description="Give your interface a little warmth."
        defaultChecked
        name="lighting"
      />
    </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