{`npm install @nib-components/expander\n`}
\n {`import Expander from '@nib-components/expander';\n`}
\n {`() => {\n const [expanded, setExpanded] = React.useState(false);\n return (\n <>\n setExpanded(!expanded)}>{expanded ? 'Collapse' : 'Expand'} \n \n Lorem ipsum dolor si amet parturient neque scelerisque condimentum massa \n \n >\n );\n};\n`}
\n {`Prop`} | \n{`Type`} | \n{`Default`} | \n{`Description`} | \n
---|---|---|---|
{`boolean`} | \n\n | {`Whether the expandable section is hidden or not.`} | \n|
{`function`} | \n\n | {`A function called when the Expander expands.`} | \n|
{`function`} | \n\n | {`A function called before the Expander expands. Useful for timing animations or layout effects.`} | \n|
{`function`} | \n\n | {`A function called when the Expander collapses.`} | \n|
{`function`} | \n\n | {`A function called before the Expander collapses. Useful for timing animations or layout effects.`} | \n
{`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`}{`.`}
\n{`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.`}
\n