Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Disclosure
Single disclosure / collapsible section.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/disclosure.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/disclosure.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/disclosure.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/disclosure.
Import
import { Disclosure, DisclosureContent, DisclosureTrigger} from "@/components/ui/disclosure"example.tsx
import { Disclosure, DisclosureContent, DisclosureTrigger,} from "@/components/ui/disclosure"export function Example() { return ( <Disclosure defaultOpen> <DisclosureTrigger>Show details</DisclosureTrigger> <DisclosureContent> Disclosure content expands with a height animation. </DisclosureContent> </Disclosure> )}API Reference
Disclosure
Base UI Collapsible root.
| Prop | Type | Default |
|---|---|---|
| defaultOpen | boolean | — |
| open | boolean | — |
| onOpenChange | (open: boolean) => void | — |