aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/headings/heading.stories.tsx
blob: 9958af92f12277d2d2fe54caa7588a4220860c6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { ComponentMeta, ComponentStory } from '@storybook/react';
import HeadingComponent from './heading';

export default {
  title: 'Atoms/Headings',
  component: HeadingComponent,
  argTypes: {
    children: {
      description: 'Heading body.',
      type: {
        name: 'string',
        required: true,
      },
    },
    level: {
      control: {
        type: 'select',
      },
      description: 'Heading level.',
      options: [1, 2, 3, 4, 5, 6],
      type: {
        name: 'number',
        required: true,
      },
    },
  },
} as ComponentMeta<typeof HeadingComponent>;

const Template: ComponentStory<typeof HeadingComponent> = (args) => {
  const { level, ...props } = args;
  return <HeadingComponent level={level || 1} {...props} />;
};

export const Heading = Template.bind({});
Heading.args = {
  children: 'Your title',
};