The Expander is used for hiding and showing information.
npm install @nib-components/expander
import Expander from '@nib-components/expander';
|Whether the expandable section is hidden or not.
|A function called when the Expander expands.
|A function called before the Expander expands. Useful for timing animations or layout effects.
|A function called when the Expander collapses.
|A function called before the Expander collapses. Useful for timing animations or layout effects.
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.