Skip to main content

Pivotal UI

v19.0.0
Components / Collapsible

Collapsible

The Collapsible component can be used to hide and show elements. By default, it animates the expanding and collapsing of its content, but this can be configured through props.

Basic example

The Collapsible's expanded prop comes from the outer component's state.

ReferenceError: React is not defined

Props

PropertyRequiredTypeDefaultDescription
delaynoNumber200Duration (in milliseconds) of expand/collapse animation
expandednoBooleanWhether the component is expanded
onEnterednoFunctionCallback called when animation begins
onExitednoFunctionCallback called when animation ends

Imports

Import React components (including CSS):

import {Collapsible} from 'pivotal-ui/react/collapsible';