Navigation

Disclosure Group | Accordion

Disclosure Group is a vertical stack of headers that expand or collapse to show or hide content, providing an organized, user-friendly way to manage information.

Basic

An disclosure functions as a vertical stack of headers that expand to reveal or conceal content sections.

Installation

If you hit any issues, make sure you check out the installation guide here for more information.

Manual Installation

Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.

Anatomy

Default Expanded

Set the initially expanded sections by providing an array of keys to the defaultExpandedKeys prop. These keys can be either numbers or strings.

Yes, you can upgrade or downgrade your subscription plan at any time from your account settings.

Allow Multiple Expanded

Allow multiple sections to be expanded at once by using the allowsMultipleExpanded prop.

Yes, you can upgrade or downgrade your subscription plan at any time from your account settings.

Your past orders can be viewed in the 'Orders' section of your account dashboard.

Nested

Disclosure Groups can be nested to create a hierarchy of sections. Use the DisclosurePanel component to add content to each nested group. To ensure a polished appearance, make sure the trigger within the nested group includes a span, as shown below:

<DisclosurePanel className="bg-[color-mix(in_oklab,var(--color-muted)_70%,black_15%)]">
  <DisclosureGroup allowsMultipleExpanded>
    {item.children.map((child, childIndex) => (
      <Disclosure key={childIndex} id={childIndex}>
        <DisclosureTrigger>
          <span>

Check out the example below to see it in action.

With Icon

You can add icons to the disclosure group to make it more visually appealing.

Hide Border

To remove the border between sections, simply apply standard Tailwind CSS classes.

Hide Indicator

To remove the visual indicator (arrow), use standard Tailwind CSS classes.

Hide Everything

If you want to hide both the border and the indicator, use the hideBorder and hideIndicator props.

Disabled

Disable specific sections by adding the isDisabled prop to the corresponding item.