Disclosure

Accordion.

Make room for the details.

Live preview

Live preview

Layered light, soft peach blooms, and a fine illuminated edge give every component a sense of depth.

tsx
import { Accordion } from "luminescent";
import "luminescent/style.css";


export function Example() {
  return (
    <Accordion title="What makes it luminescent?" defaultExpanded>
      Semantic tokens, carefully layered light, and native interactions.
    </Accordion>
  );
}

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: expanded / defaultExpanded / onChange. 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 { Accordion } from "luminescent";


export function ControlledExample() {
  const [value, setValue] = useState(false);
  return (
    <Accordion title="Details" expanded={value} onChange={setValue}>
      Your project details.
    </Accordion>
  );
}

API reference

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

PropTypeDetails
titlerequiredReact.ReactNodeOptional unless marked required.
expandedbooleanOptional unless marked required.
defaultExpandedbooleanOptional unless marked required.
onChange(expanded: boolean) => voidOptional unless marked required.
disabledbooleanOptional unless marked required.
glowColorGlowColorOptional unless marked required.
headingLevel2 | 3 | 4 | 5 | 6Optional unless marked required.

Accessibility and keyboard

Tab to a heading; Enter or Space toggles its associated region. Collapsed content is hidden from the tab order.

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


export function Example() {
  return (
    <LuminescentProvider theme="light" accent="violet" glow="subtle">
      <Accordion title="What makes it luminescent?" defaultExpanded>
        Semantic tokens, carefully layered light, and native interactions.
      </Accordion>
    </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