signal-desktop/ts/components/Checkbox.stories.tsx
2021-08-18 13:08:14 -07:00

27 lines
760 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import { Checkbox, PropsType } from './Checkbox';
const createProps = (): PropsType => ({
checked: false,
label: 'Check Me!',
name: 'check-me',
onChange: action('onChange'),
});
const story = storiesOf('Components/Checkbox', module);
story.add('Normal', () => <Checkbox {...createProps()} />);
story.add('Checked', () => <Checkbox {...createProps()} checked />);
story.add('Description', () => (
<Checkbox {...createProps()} description="This is a checkbox" />
));
story.add('Disabled', () => <Checkbox {...createProps()} disabled />);