Disclosure
An interactive UI component that expands or collapses content sections, improving accessibility and user experience. It helps organize large information.
Installation
Install the component via the CLI in one command.
npx shadcn@latest add @intentui/disclosure-group
Manual installation
Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.
npm install react-aria-components @heroicons/react tailwind-merge
Anatomy
import { Disclosure, DisclosurePanel, DisclosureTrigger } from "@/components/ui/disclosure-group";<Disclosure>
<DisclosureTrigger>
Trigger
</DisclosureTrigger>
<DisclosurePanel>
Content
</DisclosurePanel>
</Disclosure>Examples
Disabled
You can disable all disclosure by setting the isDisabled prop.
Controlled
You can control the disclosure by using the isExpanded prop.
Accordion
If you're looking for a more advanced accordion, check out the Disclosure Group component.
Component API
Disclosure
The Disclosure component wraps a collapsible content item.
| Prop | Type | Default |
|---|---|---|
className | string | - |
DisclosureGroup
The DisclosureGroup component groups related disclosure items.
| Prop | Type | Default |
|---|---|---|
className | string | - |
DisclosureIndicator
The DisclosureIndicator component renders the disclosure expand icon.
| Prop | Type | Default |
|---|---|---|
className | string | - |
DisclosurePanel
The DisclosurePanel component contains collapsible disclosure content.
| Prop | Type | Default |
|---|---|---|
className | string | - |
DisclosureTrigger
The DisclosureTrigger component toggles a disclosure item.
| Prop | Type | Default |
|---|---|---|
className | string | - |
triggerIndicator | boolean | true |
See the React Aria for the full API reference.
Unlock the full power ofIntent UI Design
Build modern web apps faster with 1000+ resources across components, blocks, patterns, templates, and starter kits.