Basic
An disclosure functions as a vertical stack of headers that expand to reveal or conceal content sections.
Preview
Code
Installation
CLI
Manual
npx hq-kit add disclosure
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.
Preview
Code
Allow Multiple Expanded
Allow multiple sections to be expanded at once by using the allowsMultipleExpanded
prop.
Preview
Code
Border Hidden
Eliminate the border between sections by using the hideBorder
prop.
Preview
Code
Hide Indicator
Eliminate the visual indicator (arrow key) by using the hideIndicator
prop.
Preview
Code
Hide Everything
You may want to hide the entire disclosure attribute like border or indicator. You can do that by using the hideBorder
and hideIndicator
props.
Preview
Code
Disabled
You can disabled specific sections by using the isDisabled
props to the item.
Preview
Code