Disclosure

Examples

Disclosure

Dark Modern
import {ReactNode} from "react"
import {
DisclosureActions,
DisclosureBody,
DisclosureDescription,
DisclosureHeader,
DisclosureLabel,
DisclosureRoot,
Icon,
} from "@qui/react-vscode"
export default function Showcase(): ReactNode {
return (
<DisclosureRoot className="w-full max-w-[300px]">
<DisclosureHeader>
<DisclosureLabel>
Label
<DisclosureDescription>Description</DisclosureDescription>
</DisclosureLabel>
<DisclosureActions>
<Icon as="button" icon="new-file" />
</DisclosureActions>
</DisclosureHeader>
<DisclosureBody>
Suspendisse potenti. Maecenas eu egestas metus. Nulla eget placerat mi,
et efficitur augue.
</DisclosureBody>
</DisclosureRoot>
)
}

API

DisclosureRootProps

Name & DescriptionOption(s)Default
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'div'
React children prop.
ReactNode
The default value when uncontrolled.
boolean
Callback fired when panel visibility changes.
  • isOpenThe updated state. If true, the panel is visible.
  • eventthe DOM event that triggered the change.
(
isOpen: boolean,
event?: SyntheticEvent,
) => void
The controlled state for the component's visibility.
boolean
Type
| ElementType
| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or element.
Description
React children prop.
Type
boolean
Description
The default value when uncontrolled.
Type
(
isOpen: boolean,
event?: SyntheticEvent,
) => void
Description
Callback fired when panel visibility changes.
  • isOpenThe updated state. If true, the panel is visible.
  • eventthe DOM event that triggered the change.
Type
boolean
Description
The controlled state for the component's visibility.

DisclosureBodyProps

Name & DescriptionOption(s)Default
Animate the hide/show of the body.
boolean
true
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'div'
React children prop.
ReactNode
Controlled id. If omitted, a unique identifier will be automatically generated for accessibility.
string
Type
boolean
Default
true
Description
Animate the hide/show of the body.
Type
| ElementType
| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or element.
Description
React children prop.
Type
string
Description
Controlled id. If omitted, a unique identifier will be automatically generated for accessibility.

DisclosureHeaderProps

Name & DescriptionOption(s)Default
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'div'
React children prop.
ReactNode
Controlled id. If omitted, a unique identifier will be automatically generated for accessibility.
string
Type
| ElementType
| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or element.
Description
React children prop.
Type
string
Description
Controlled id. If omitted, a unique identifier will be automatically generated for accessibility.