Core Components
Number Effects
Interactive Elements
Advanced Effects
Radix UI Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Base UI Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Disclosure#
The Disclosure component allows users to toggle the visibility of content, either collapsed or expanded.
Examples#
Basic Disclosure#
Disclosure with custom animation#
Image from Les others studio
Installation#
npx shadcn@latest add "https://components.dylanwlim.com/c/disclosure.json"
Component API#
Disclosure#
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | false | Controls the visibility of the content. |
| onOpenChange | (open: boolean) => void | Callback function to handle changes in the open state. | |
| children | ReactNode | The content to be toggled, typically includes DisclosureTrigger and DisclosureContent. | |
| className | string | Additional CSS classes for the container. | |
| variants | { expanded: Variant; collapsed: Variant } | Custom animation variants for expanded and collapsed states. | |
| transition | Transition | Custom transition settings for the motion animations. |
DisclosureTrigger#
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The trigger element that will toggle the disclosure. | |
| className | string | Additional CSS classes for the trigger element. |
DisclosureContent#
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The content that will be shown or hidden by the disclosure. | |
| className | string | Additional CSS classes for the content container. |
Build with DWL Components
Use the copied registry, charts, blocks, and create tools in one place.
Start from the DWL Components create flow and customize from there.
Open DWL Components Create