Accordion
A vertically stacked set of interactive headings that each reveal a section of content.
Usage
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from '@epilot/spark-ui/accordion'<Accordion>
<AccordionItem value="item-1">
<AccordionTrigger>Is it accessible?</AccordionTrigger>
<AccordionContent>
Yes. It adheres to the WAI-ARIA design pattern.
</AccordionContent>
</AccordionItem>
</Accordion>Examples
Variants
Container chrome is set with the variant prop (default soft). All variants use
neutral chrome and scale with the spacing / scaling knobs.
soft
Charge when solar output is highest.
surface
Charge when solar output is highest.
outline
Charge when solar output is highest.
ghost
Charge when solar output is highest.
Multiple open at once
Pass multiple to allow several panels to be open simultaneously.
Smart charging optimises charging based on solar production and energy prices.
Yes. Use boost mode to charge at full power immediately.
API Reference
This component is built on top of Base UI Accordion. See the Base UI documentation for the full API reference.
Components
Accordion: Root container; single-open and collapsible by default, passmultipleto keep several panels open (value/defaultValueare arrays). Also accepts avariant.AccordionItem: Individual collapsible section. Requires avalue.AccordionTrigger: Clickable header that toggles the section (min 44px touch target).AccordionContent: Wraps the body content of a section.
Spark additions
| Prop | Type | Default |
|---|---|---|
Accordion.variant | "ghost" | "soft" | "surface" | "outline" | "soft" |
ghost: no border/fill, just the trigger and spacing.soft: separate soft-tinted rounded cards, with a small gap between stacked items.surface: items glued into one bordered panel with an opaque fill.outline: the same glued bordered panel, but no fill.- The trigger has a min 44px touch target and no text underline; padding scales with the spacing / scaling knobs.