Skip to contentKino
Skip to Content

Collapsible

A header row that shows or hides one section, its chevron turning down as the section opens.

npx shadcn add https://kinoui.com/r/collapsible.json
Share on

Examples

Default

Each section opens on its own. Its chevron turns down, and the panel pushes what sits below it.

Controlled

Hold open yourself to open sections from elsewhere, as Expand all does.

Content that changes height

Content that grows or shrinks while the panel is open takes the panel, and what sits below, with it.

Find in page

With hiddenUntilFound, the browser’s find in page searches the closed panel and opens it on a match. Press ⌘F or Ctrl+F and search for Lisboa.

Disabled

A disabled collapsible fades and stays as it is.

Installation

npx shadcn@latest add https://kinoui.com/r/collapsible.json
Files
lib/reduce-motion.tslib/resize.tscomponents/kino/collapsible.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Collapsible

PropTypeDefaultDescription
defaultOpenbooleanfalseWhether it starts open, when you leave the state to it.
openbooleanNoneWhether it is open, when you hold the state.
onOpenChange(open) => voidNoneCalled when it opens or closes.
disabledbooleanfalseFades the trigger and keeps the section as it is.

CollapsibleContent

PropTypeDefaultDescription
classNamestringNoneGoes on the box with the padding, the one you lay out.
hiddenUntilFoundbooleanfalseLets the browser's find in page search the closed panel and open it on a match. Chromium and Firefox support it.
keepMountedbooleanfalseKeeps the content in the page while closed.

Data attributes

AttributeOnDescription
data-openCollapsible, CollapsibleContentPresent while it is open.
data-panel-openCollapsibleTriggerPresent while its panel is open.
data-disabledCollapsible, CollapsibleTrigger, CollapsibleContentPresent while it is disabled.

Accessibility

  • The trigger is a button with aria-expanded, and aria-controls names the panel. Enter or Space opens or closes it.
  • The chevron is hidden from screen readers; the expanded state says the same.
  • When the system asks for less motion, the panel opens and closes at once, the chevron jumps to its place, and content still fades.