ReviewOS

stacks/stx

Built-in Accordion component (<StxAccordion>)

#1679
Closed glennmichael123 opened this 23 days ago · 1 comment
23 days ago

Summary

Collapsible content sections — for FAQs, settings groups, and sidebars.

Usage

<StxAccordion>
  <StxAccordionItem title="What is stx?" default-open>
    <p>stx is a modern templating engine powered by Bun.</p>
  </StxAccordionItem>
  <StxAccordionItem title="How fast is it?">
    <p>44.1% faster than VanillaJS benchmarks.</p>
  </StxAccordionItem>
</StxAccordion>

<!-- Single open mode -->
<StxAccordion type="single">...</StxAccordion>

Props

  • <StxAccordion>: type (single/multiple), collapsible (allow all closed)
  • <StxAccordionItem>: title, icon, default-open, disabled

Features

  • Smooth height animation (CSS max-height transition)
  • Chevron rotation indicator
  • Keyboard: Enter/Space to toggle
  • ARIA: expanded/controls
23 days ago

Delivered via @stacksjs/components, which ships with every stx app and is auto-registered (no import needed in .stx files). See CLAUDE.md § "Reach for stx primitives before vanilla JS" for the full inventory; the relevant components for this request are documented there.

Closing as effectively delivered. If a specific behavior or API affordance from the original request is missing from the shipped components, please open a focused ticket against @stacksjs/components describing the exact gap — that's easier to track than a broad "make it a builtin" ask.

Sign in to comment on this issue.