Collapse

Collapse

import Collapse from "@kiwicom/orbit-components/lib/Collapse";
<Collapse label="Duration">
<Slider defaultValue={5} onChange={value => doSomething(value)} />
</Collapse>

Props

NameTypeDefaultDescription
actionsReact.NodeActions which will be render next to arrow.
childrenReact.NodeThe children that should be collapsed.
idstringSet id for Collapse.
dataTeststringOptional prop for testing purposes.
expandedbooleanPassing true or false makes Collapse a controlled component, requiring you to manage its state via onClick.
initialExpandedbooleanfalseIf true the Collapse component will be expanded on the initial render. To be used when the component is uncontrolled.
labelstringThe rendered label of the Collapse.
customLabelReact.NodeAllows for rendering any component as a label.
onClick(event, state) => void \| PromiseCallback for handling onClick event.
expandButtonLabelstringThe accessible label of the button when the content is collapsed.
collapseButtonLabelstringThe accessible label of the button when the content is expanded.