Components
Accordion
A vertically stacked set of interactive headings that reveal or hide associated content panels.
Yes! Every component is built with accessible primitives, responsive tokens, and smooth spring physics.
import {
Accordion,
AccordionItem,
AccordionPanel,
AccordionTrigger,
} from "@/components/ui/accordion";
export default function Particle() {
const items = [
{
content:
"taut-ui combines shadcn UI patterns with tactile spring motion, corner morphing, and accessible Base UI primitives.",
id: "1",
title: "What is taut-ui?",
},
{
content:
"Browse the components in the documentation and copy the code or install via shadcn CLI directly into your project.",
id: "2",
title: "How do I get started?",
},
{
content:
"Yes! Every component is built with accessible primitives, responsive tokens, and smooth spring physics.",
id: "3",
title: "Is it production ready and accessible?",
},
];
return (
<Accordion className="w-full" defaultValue={["3"]}>
{items.map((item) => (
<AccordionItem key={item.id} value={item.id}>
<AccordionTrigger>{item.title}</AccordionTrigger>
<AccordionPanel>{item.content}</AccordionPanel>
</AccordionItem>
))}
</Accordion>
);
}
Installation
pnpm dlx shadcn@latest add @taut-ui/accordion
Usage
import {
Accordion,
AccordionItem,
AccordionPanel,
AccordionTrigger,
} from "@/components/ui/accordion"<Accordion defaultValue={["item-1"]}>
<AccordionItem value="item-1">
<AccordionTrigger>Is it accessible?</AccordionTrigger>
<AccordionPanel>
Yes. It adheres to the WAI-ARIA design pattern and is fully keyboard navigable.
</AccordionPanel>
</AccordionItem>
<AccordionItem value="item-2">
<AccordionTrigger>Is it animated?</AccordionTrigger>
<AccordionPanel>
Yes. Panel height, corner morphing, and indicator rotation all animate with spring motion.
</AccordionPanel>
</AccordionItem>
</Accordion>Examples
Multiple
You can expand more than one section at the same time when the multiple prop is enabled.
Each expanded item detaches smoothly from its neighbors with spring motion and rounded corners.
import {
Accordion,
AccordionItem,
AccordionPanel,
AccordionTrigger,
} from "@/components/ui/accordion";
const items = [
{
content:
"You can expand more than one section at the same time when the multiple prop is enabled.",
id: "1",
title: "Can I open multiple items at once?",
},
{
content:
"Each expanded item detaches smoothly from its neighbors with spring motion and rounded corners.",
id: "2",
title: "How do the surfaces transition?",
},
{
content:
"Disabled items stay visible in the list while preventing interaction and keyboard focus.",
id: "3",
title: "What about disabled items?",
},
];
export default function Particle() {
return (
<Accordion className="w-full" defaultValue={["1", "2"]} multiple>
{items.map((item) => (
<AccordionItem key={item.id} value={item.id}>
<AccordionTrigger>{item.title}</AccordionTrigger>
<AccordionPanel>{item.content}</AccordionPanel>
</AccordionItem>
))}
</Accordion>
);
}
With Icons
Built on tonal surfaces and CSS tokens that adapt cleanly between light and dark themes.
import { PaletteIcon, ShieldCheckIcon, ZapIcon } from "lucide-react";
import {
Accordion,
AccordionItem,
AccordionPanel,
AccordionTrigger,
} from "@/components/ui/accordion";
const items = [
{
content:
"Built on tonal surfaces and CSS tokens that adapt cleanly between light and dark themes.",
icon: PaletteIcon,
id: "1",
title: "Surface-first design",
},
{
content:
"Keyboard navigation, ARIA attributes, and focus management are handled out of the box by Base UI.",
icon: ShieldCheckIcon,
id: "2",
title: "Accessible by default",
},
{
content:
"Spring-based height, corner morphing, and ripple feedback respect prefers-reduced-motion.",
icon: ZapIcon,
id: "3",
title: "Expressive motion",
},
];
export default function Particle() {
return (
<Accordion className="w-full" defaultValue={["1"]}>
{items.map((item) => (
<AccordionItem key={item.id} value={item.id}>
<AccordionTrigger>
<span className="flex items-center gap-3">
<item.icon className="size-4 shrink-0 text-muted-foreground" />
<span>{item.title}</span>
</span>
</AccordionTrigger>
<AccordionPanel>{item.content}</AccordionPanel>
</AccordionItem>
))}
</Accordion>
);
}
API Reference
Accordion
Wraps Accordion.Root from Base UI. Manages open state and keyboard navigation across items.
| Prop | Type | Default | Description |
|---|---|---|---|
multiple | boolean | false | Whether multiple items can be open at the same time |
value | unknown[] | - | Controlled array of currently open item values |
defaultValue | unknown[] | - | Initial array of open item values when uncontrolled |
onValueChange | (value: unknown[]) => void | - | Called when the open items change |
loopFocus | boolean | true | Whether keyboard focus loops from the last item back to the first |
disabled | boolean | false | Disables all items within the accordion |
...props | Base UI Accordion Root props | - | All other Accordion Root props are supported |
AccordionItem
A single collapsible section with segmented surface styling and corner morphing.
| Prop | Type | Default | Description |
|---|---|---|---|
value | unknown | - | Unique identifier for the item |
disabled | boolean | false | Disables this individual item |
className | string | - | Additional CSS classes |
...props | Base UI Accordion Item props | - | All standard accordion item props |
AccordionTrigger
The interactive header button that toggles the item's panel. Includes a ripple effect and rotating chevron indicator.
| Prop | Type | Description |
|---|---|---|
className | string | Additional CSS classes |
...props | Base UI Accordion Trigger props | All standard accordion trigger props |
AccordionPanel
The collapsible content container with animated height and opacity transitions. Also exported as AccordionContent.
| Prop | Type | Description |
|---|---|---|
className | string | Additional CSS classes |
...props | Base UI Accordion Panel props | All standard accordion panel props |