import type { Meta, StoryFn } from '@storybook/react'; import { useState } from 'react'; import { Checkbox } from './checkbox'; export default { title: 'UI/Checkbox', component: Checkbox, parameters: { chromatic: { disableSnapshot: true }, }, } satisfies Meta; export const Basic: StoryFn = props => { const [checked, setChecked] = useState(props.checked); const handleChange = ( _event: React.ChangeEvent, checked: boolean ) => { setChecked(checked); props.onChange?.(_event, checked); }; return (
); }; Basic.args = { checked: true, disabled: false, indeterminate: false, onChange: console.log, };