Skip to content

Browse components

← All components

Disclosure

Single disclosure / collapsible section.

Install
npx shadcn@latest add https://ui.anuragroy.dev/r/disclosure.json

Preview

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.json

GitHub fallback if the website is down:

Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/disclosure.json

Usage

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.

PropTypeDefault
defaultOpenboolean—
openboolean—
onOpenChange(open: boolean) => void—