Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
_tests_ NEW: Collapse component (#1140) Jul 30, 2019
Collapse.stories.js NEW: Collapse component (#1140) Jul 30, 2019
README.md NEW: Collapse component (#1140) Jul 30, 2019
index.js NEW: Collapse component (#1140) Jul 30, 2019
index.js.flow NEW: Collapse component (#1140) Jul 30, 2019

README.md

Collapse

To implement Collapse component into your project you'll need to add the import:

import Collapse from "@kiwicom/orbit-components/lib/Collapse";

After adding import into your project you can use it simply like:

<Collapse label="Duration">
  <Slider defaultValue={5} onChange={(value) => doSomething(value)} />
</Collapse>

Props

Table below contains all types of the props available in the Collapse component.

Name Type Default Description
children React$Node The children that should be collapsed.
dataTest string Optional prop for testing purposes.
expanded boolean If you pass either true or false the Collapse component will controlled component and you will have to manage the state via onClick.
initialExpanded boolean false If true the Collapse component will be expanded on the initial render.
label Translation The rendered label of the Collapse.
onClick (event, state) => void | Promise Callback for handling onClick event.
You can’t perform that action at this time.