Disclosure
A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.
The default <Disclosure> dictating the layout and borders of multiple Disclosure components.
Usage
import { Disclosure } from '@console/nimbus-ui/core';Examples
Variant
Disclosures come in four distinct visual variants= enclosed | outline | subtle | plain.
No Icon
The default <Disclosure> without an icon.
Custom Icon
The default <Disclosure> with a custom icon.
Custom Icon Render Props
The default <Disclosure> with a custom icon.
This example uses custom render props to control the icon displayed.
Default Expanded
Use defaultExpanded prop to control the initial expanded state.
Disabled
Use isDisabled prop to control the disabled state.
API
Disclosure
| Prop | Type | Default | Description |
|---|---|---|---|
| data-rac-id | string | — | |
| data-testid | string | — | |
| variant | enum | outline |
Disclosure.Header
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — |
DisclosureGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| data-testid | string | — | |
| variant | enum | enclosed |
DisclosureGroup
A DisclosureGroup is a grouping of related disclosures, usually called an accordion. It supports both single and multiple expanded items.
The default <DisclosureGroup> dictating the layout and borders of multiple Disclosure components.
Usage
import { DisclosureGroup, Disclosure } from '@console/nimbus-ui/core';Examples
Variant
Disclosures groups come in four distinct visual variants: enclosed, outline, subtle, and plain.
Allows Multiple
Whether multiple disclosure items can be expanded at the same time.
Disabled
Applying the isDisabled prop prevents user interaction and applies a dimmed visual state to the entire group.
API
Disclosure
| Prop | Type | Default | Description |
|---|---|---|---|
| data-rac-id | string | — | |
| data-testid | string | — | |
| variant | enum | outline |
Disclosure.Header
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — |
DisclosureGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| data-testid | string | — | |
| variant | enum | enclosed |
React Aria
Figma