Pro
Fold panel
An accordion whose sections are hinged to their headers. Opening turns a section down from edge-on to flat while its height opens, so you can see which header it belongs to and where it goes when it closes. It is the standard accordion underneath: header buttons, aria-expanded, regions named by their header.
pnpm dlx shadcn@latest add @caliper/fold-panelWhen to use
Use it for
- Checkout, settings and order summaries where each section has a one-line summary worth showing while closed.
- Anywhere an accordion should feel attached to its header instead of sliding in from nowhere.
Skip it when
- Long article text; a fold per paragraph is a lot of motion.
- Navigation; use the sidebar or tabs.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Depth carries attachment
- The hinge is the header's bottom edge. The section is the only thing that turns, so the text is flat the moment it is readable.
- One open or several is a prop
- type is single or multiple, and value is always the list of open ids, so switching between them never changes how you read state.
Usage
- Closed means inert
- A closed section is inert, so Tab never lands in it and screen readers skip it. Focus stays on the header you pressed.
Installation
pnpm dlx shadcn@latest add @caliper/fold-panel
Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { FoldPanel } from "@/components/ui/fold-panel"
The worked example comes with Pro
The 47-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
FoldPanel
component
Accessibility
It is built on native elements and keeps aria-expanded, aria-controls, aria-hidden and aria-labelledby in step with state.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.