Auto height
A container that follows its content's height, so a wizard step, a validation summary or a details panel grows and shrinks instead of snapping. The content changes at once.
When to use
- Content that changes length after an action: a step, an error list, a toggle that adds fields.
- Cards whose body swaps between states.
When not to use
- Content that changes while people read it, such as streaming text.
- Accordions; the accordion handles its own height.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/auto-height
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.
API reference
AutoHeight
0 props
No props of its own; it accepts the native props of its root element.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements, so roles and focus come from the browser.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/auto-height.mdThe index of every part is at /llms.txt.