storybook/docs/snippets/react/checkbox-story-csf.ts.mdx
Norbert de Langen c0240f8ec5
changes
2022-06-21 18:30:05 +02:00

26 lines
726 B
Plaintext

```ts
// Checkbox.stories.ts|tsx
import React from 'react';
import { ComponentMeta, ComponentStoryFn } from '@storybook/react';
import { Checkbox } from './Checkbox';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Checkbox',
component: Checkbox,
} as ComponentMeta<typeof Checkbox>;
export const allCheckboxes: ComponentStoryFn<typeof Checkbox> = () => (
<form>
<Checkbox id="Unchecked" label="Unchecked" />
<Checkbox id="Checked" label="Checked" checked />
<Checkbox appearance="secondary" id="second" label="Secondary" checked />
</form>
);
```