Collapsible
A single native disclosure with controlled or initial state.
Interactive preview
Advanced workspace settings
Only change this if your project needs a different alias.
Usage
import { Collapsible } from "@devvy-ui/react";
<Collapsible summary="Advanced settings"><p>Adjust these options for your workspace.</p></Collapsible>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| summary | ReactNode | required | Visible disclosure trigger text. |
| open / defaultOpen / onOpenChange | boolean / boolean / callback | — / false / — | Controlled or initial expansion. |
| disabled | boolean | false | Keep the summary discoverable without activation. |
Accessibility & behavior
Platform Behavior & Guidelines
Uses details/summary so closed content stays out of keyboard navigation. Enter/Space activate the native summary. Controlled requests wait for the caller. Do not add focusable controls inside the summary. onToggle and native details props remain available.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add collapsibleMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.