Components

Collapsible

A lightweight disclosure primitive for revealing supporting content inline without leaving the current screen.

Tap to show a QR code for the Expo showcase deep link. The web preview below runs in the browser.

Loading...

Installation

Install the registry item directly, then add any package dependencies if you are setting the component up manually.

1

Install the component

Run the registry command below to add collapsible to your project.

watermelon add collapsible
2

Import the component

Import Collapsible from your local UI registry output.

Import

import { Collapsible } from "@/components/ui/collapsible";

Import

Import

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

Usage

Use Collapsible when the user should stay on the same surface while revealing optional context.

Loading...

API Reference

proptypedefaultdescription
defaultOpenbooleanfalseSets the initial open state for uncontrolled usage.
openboolean-Controls the collapsible state externally.
onOpenChange(open: boolean) => void-Called whenever the open state changes.
asChildbooleanfalseLets the trigger forward press handling into an existing child component.