import React from "react"; import CheckboxComponent from "./"; export default { title: "Components/Checkbox", component: CheckboxComponent, parameters: { docs: { description: { component: "Custom checkbox input" }, }, }, argTypes: { onChange: { action: "onChange", }, }, }; class Checkbox extends React.Component { constructor(props) { super(props); this.state = { isChecked: false, }; } onChange = (e) => { this.props.onChange(e); this.setState({ isChecked: !this.state.isChecked }); }; render() { return ( ); } } const Template = (args) => { return ; }; const AllCheckboxesTemplate = (args) => { return (
); }; export const Default = Template.bind({}); Default.args = { label: "Checkbox label", }; export const AllCheckboxStates = AllCheckboxesTemplate.bind({});