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. See accessibility tab.
customLabelReact.NodeAllows for rendering any component as a label. See accessibility tab.
onClick(event, state) => void \| PromiseCallback for handling onClick event.
expandButtonLabelstringRequired prop for accessible label of the button when the content is collapsed. See accessibility tab.
collapseButtonLabelstringRequired prop for accessible label of the button when the content is expanded. See accessibility tab.