UNPKG

@cimpress/react-components

Version:
13 lines 746 B
import React, { useState } from 'react'; import { Accordion, Checkbox } from '@cimpress/react-components'; const AccordionCheckbox = () => { const [expanded, setExpanded] = useState(false); const toggleExpanded = () => { setExpanded(!expanded); }; return (React.createElement("div", null, React.createElement(Checkbox, { label: "Open accordion", checked: expanded, onChange: toggleExpanded }), React.createElement(Accordion, { customOpen: expanded, title: React.createElement("span", null, "I am controlled by the checkbox"), className: "another-class" }, "You can also expand and collapse me with the arrow, as usual."))); }; export default AccordionCheckbox; //# sourceMappingURL=AccordionCheckbox.js.map