Sha256: 68ac581387694cd64eb5aecb2f1e2c1abbc695b0d250064c6a4cb22c1cea9497
Contents?: true
Size: 1.02 KB
Versions: 76
Compression:
Stored size: 1.02 KB
Contents
/* @flow */ import classnames from 'classnames' import React, { useContext } from 'react' import AnimateHeight from 'react-animate-height' import { buildCss } from '../../utilities/props' import { globalProps } from '../../utilities/globalProps.js' import { CollapsibleContext } from '../_collapsible.jsx' type CollapsibleContentProps = { children: array<React.ReactNode> | React.ReactNode | string, className?: string, padding?: string, } const CollapsibleContent = ({ children, className, padding = 'md', ...props }: CollapsibleContentProps) => { const context = useContext(CollapsibleContext) const contentCSS = buildCss('pb_collapsible_content_kit') const contentSpacing = globalProps(props, { padding }) return ( <div className={classnames(contentCSS, className, contentSpacing)}> <AnimateHeight duration={300} height={context.collapsed ? 0 : 'auto'} id="bottom-section" > {children} </AnimateHeight> </div> ) } export default CollapsibleContent
Version data entries
76 entries across 76 versions & 1 rubygems