The Expander is used for hiding and showing information.
npm install @nib-components/expander
import Expander from '@nib-components/expander';
|boolean||Whether the expandable section is hidden or not.|
|function||A function called when the expander starts expanding.|
|function||A function called when the expander starts collapsing.|
Don't use top-level vertical margins
An alternative is the Accordion component, which we encourage as it allows search engines to see hidden content. Also, be cautious of unnecessarily hiding information from the user. If in doubt, use the Accordion.
If you are using the Expander component to hide and show a number of items, consider using the Expander Group component from the interactive demo to control the behaviour of the group.