Collection of theme-ui and external components.
created:3/15/2021
updated:3/15/2021
source lines:17
comments %:41

Collapsible

Animated expand/collapse container component, using react-animate-height.

Component

import { Collapsible } from '@component-controls/components';

Overview

({ easing }) => {
const [isOpen, setIsOpen] = useState(false);
return (
<Box>
<Button onClick={() => setIsOpen(!isOpen)}>
{isOpen ? 'close' : 'open'}
</Button>
<Collapsible isOpen={isOpen} easing={easing}>
<Donut value={1 / 2} />
</Collapsible>
</Box>
);
}

Controls

Name
Description
Default
Controls
easing
string
-

Properties

Name
Description
Default
CollapsibleOwnProps (1 properties)
isOpen

controlled open state

boolean
-
HTMLAttributes (44 properties)
AriaAttributes (48 properties)
DOMAttributes (159 properties)
- (10 properties)

External dependencies

package
imports
peer
react
^17.0.1
ReactFC
*
AnimateHeightAnimateHeightProps

Component JSX