Accordion
Expandable sections with arrow-key navigation and a shared hover highlight.
Installation
Import from the Reflow workspace package.
Playground
Open demoimport { Accordion } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
const items = [
{
"value": "item-1",
"title": "Getting Started",
"content": "Install the component and import it into your project. The accordion supports both single and multiple expand modes."
},
{
"value": "item-2",
"title": "Styling",
"content": "The component integrates with the shape system for rounded, pill or sharp border-radius variants. All animations use spring physics."
},
{
"value": "item-3",
"title": "Accessibility",
"content": "Built with Remix UI primitives, accessible roles, keyboard navigation, and focus management."
},
{
"value": "item-4",
"title": "Animation",
"content": "Smooth height transitions and spring-animated chevron rotation. The fluid hover background tracks your cursor."
}
]
return () => (
<>
<Accordion defaultValue="item-1" items={items} />
</>
)
}Standalone
import { Accordion } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Accordion defaultValue="item-1" items={[
{
"value": "item-1",
"title": "What is this component?",
"content": "A collapsible accordion with animated expand/collapse and spring-animated chevron."
}
]} />
</>
)
}Single Expand
Opening a section closes the previous section.
import { Accordion } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Accordion defaultValue="item-1" items={[
{
"value": "item-1",
"title": "Getting Started",
"content": "Install the component and import it into your project. The accordion supports both single and multiple expand modes."
},
{
"value": "item-2",
"title": "Styling",
"content": "The component integrates with the shape system for rounded, pill or sharp border-radius variants. All animations use spring physics."
},
{
"value": "item-3",
"title": "Accessibility",
"content": "Built with Remix UI primitives, accessible roles, keyboard navigation, and focus management."
},
{
"value": "item-4",
"title": "Animation",
"content": "Smooth height transitions and spring-animated chevron rotation. The fluid hover background tracks your cursor."
}
]} />
</>
)
}Multi Expand
Several sections can stay open together.
import { Accordion } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Accordion type="multiple" defaultValue={['item-1', 'item-3']} items={[
{
"value": "item-1",
"title": "First Section",
"content": "Multiple items can be expanded at the same time."
},
{
"value": "item-2",
"title": "Second Section",
"content": "Click any trigger to expand or collapse independently."
},
{
"value": "item-3",
"title": "Third Section",
"content": "Each item operates independently in multiple mode."
}
]} />
</>
)
}Row highlight
Only the hovered trigger is highlighted; the open panel keeps the page surface.
import { Accordion } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
const sections = [{ label: 'Workspace', items: [
{ label: 'Inbox', href: '#inbox', badge: '3' },
{ label: 'Projects', href: '#projects' },
] }]
return () => (
<>
<Accordion defaultValue="item-1" highlight="trigger" items={[
{
"value": "item-1",
"title": "Expanded, but not tinted",
"content": "The panel reads as part of the page rather than a filled block."
},
{
"value": "item-2",
"title": "Hover any row",
"content": "The fill follows your cursor instead of marking a state."
},
{
"value": "item-3",
"title": "Compare with the sections above",
"content": "Those hold a block across the row and its panel while open."
}
]} />
</>
)
}API Reference
Public props for the Reflow implementation. Native controls also accept their standard HTML attributes and Remix event mixes.
Accordion
| Prop | Type | Default | Description |
|---|---|---|---|
type | "single" | "multiple" | single | Single or multiple expansion mode. |
value | AccordionSingleValue | AccordionMultipleValue | — | Current value when controlled by the parent. |
defaultValue | AccordionSingleValue | AccordionMultipleValue | — | Initial value for an uncontrolled component. |
children | RemixNode | — | Content rendered inside the component. |
disabled | boolean | — | Prevents interaction and conveys the disabled state. |
items* | readonly AccordionItem[] | — | Items and their content. |
variant | "grouped" | "separated" | grouped | Visual or layout treatment. |
headingLevel | 2 | 3 | 4 | 5 | 6 | 3 | Semantic heading level for accordion triggers. |
AccordionItem
| Prop | Type | Default | Description |
|---|---|---|---|
value* | string | — | Unique identifier for this accordion item. |
title* | RemixNode | — | Content of the accordion trigger. |
content* | RemixNode | — | Panel content revealed when the item is expanded. |
disabled | boolean | — | Prevents interaction and conveys the disabled state. |