Saturation UIsaturation UI
DocsComponentsBlocks
⌘K

Getting Started

IntroductionInstallationTheming

Components

AccordionAI Chat InputAlertAnimated GroupAnimated NumberAvatarBadgeBorder TrailBreadcrumbButtonButton GroupCalendarCardChartCheckboxCollapsibleComboboxCommandContext MenuData TableDate PickerDialogDropdown MenuEmptyFieldGlow EffectInputInput GroupItemKbdMenubarNovel EditorPaginationProgressive BlurProgressSelectSheetSkeletonSonnerSpinnerSpotlightSwitchTableTabsText EffectText ShimmerTextareaToggleToggle GroupTreeTypography
Components
/
Collapsible

Collapsible

An interactive component which expands/collapses a panel.

Installation

npx shadcn@latest add https://ui.saturation.io/r/collapsible.json

Usage

import {
  Collapsible,
  CollapsibleContent,
  CollapsibleTrigger,
} from "@/components/ui/collapsible"

Examples

With Icon

Add an icon that rotates when the collapsible is opened.

Controlled

Control the open state with the open and onOpenChange props.

State: Closed

File Tree

Use nested collapsibles to create a file tree structure.

components.json

API Reference

Collapsible

The root component that manages the collapsible state.

PropTypeDefaultDescription
openboolean-The controlled open state of the collapsible.
defaultOpenbooleanfalseThe open state of the collapsible when it is initially rendered.
onOpenChange(open: boolean) => void-Event handler called when the open state changes.
disabledbooleanfalseWhen true, prevents the user from interacting with the collapsible.

CollapsibleTrigger

The button that toggles the collapsible.

PropTypeDefaultDescription
asChildbooleanfalseChange the default rendered element for the one passed as a child.

CollapsibleContent

The component that contains the collapsible content.

PropTypeDefaultDescription
forceMountbooleanfalseUsed to force mounting when more control is needed.

On This Page

  • Installation
  • Usage
  • Examples
  • With Icon
  • Controlled
  • File Tree
  • API Reference

Deploy your Saturation UI app

Build beautiful, saturated interfaces with our component library.

Deploy to Vercel for the best performance and developer experience.