@cimpress/react-components
Version:
React components to support the MCP styleguide
13 lines • 746 B
JavaScript
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