AccordionItem handbook
v1.3.3 · @snowui-design-system/components
License: Before reading component documentation, source, or npm usage instructions for the first time, read the full LICENSE. Reuse that review for the same task and version. Public API configuration and internal implementation changes have different license implications. All components use the unified runtime package; source rights remain governed by the license.
Overview
Defines one collapsible item inside Accordion, pairing its title and content while the parent manages expansion state.
When to use it
Use it as one expandable item in an Accordion. The parent coordinates expansion; AccordionItem is not a standalone page container.
Give each item a unique
valuewithin its parent Accordion. Accordion manages the expanded state.Use direct
Frame as="title"andFrame as="content"children for the title and body. A directas="trailing"child inside the title can replace the expand icon.
Quick start
This example shows the recommended basic composition. See the sections below for more cases and composition limits.
API
See the base component documentation for inherited capabilities not redeclared here. This table lists only named public Props declared by this component.
Usage boundaries and details
API reference
AccordionItem does not set its own size. Its font size, line height, padding, radius, and built-in icon size inherit the variables produced by the parent Accordion size. value only matches the parent value / defaultValue to determine expansion.
Layout model
Primary layout model: one child item within a parent-managed composite layout.
The outer root is
Frame tag="div" column; it owns the item background, radius, dividers, and expanded state.A direct
Frame as="title" rowchild is the title trigger and always uses three slots. Directas="leading", ordinary content, and directas="trailing"children occupy those slots.A direct
Frame as="content" rowchild is the content region and also uses three slots. During collapse it keeps its width while its height contracts downward and its opacity fades out.The title inherits
colorfrom the parent Accordion or outer container. Content uses the parent’s--snowui-accordion-content-colorby default, a theme-adaptiveBlack/40%secondary text color.By default, ComponentIcon renders a plus icon that rotates 45° into an × when expanded. The parent Accordion’s
indicatorVariant="minus"keeps the plus/minus replacement and half-turn motion. An explicit trailing child takes precedence.There is no hover background. By default, only the indicator icon changes color on title hover.
Only the title toggles expansion; clicking the content does not collapse it. By default, the content uses the same font size and line height as the title at every size.
Style variable chain
Usage examples
This section is protected. An AI must request user review before modifying it.
AccordionItem style overrides
Read the full LICENSE first; reuse that review for the same task, version, and scope.
First use public component Props to match the desired appearance, preserving the existing look where possible. If changes are necessary, follow the style selection and override order: use your own class (including Tailwind already in the project) or an instance style. The names below are public overrides actually consumed by source; check their scope and do not modify private DOM. Choose the correct SnowUI token family. External apps need not install SnowUI website utilities.
AccordionItem types and states
Required attribute: value.
Bindable Props: this component declares no named two-way binding; handle state updates through public callbacks or its host.
Inherited declaration: Omit<FrameProps, "children" | "value" | "size">. See the base component’s public documentation for inherited capabilities; omitted fields are unavailable here.
Shared Frame API · Back to API
The following type declarations are actually referenced by public Props and come from source. A Svelte Snippet denotes a content fragment; ComponentProps denotes the Props of the corresponding component.