diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-03-31 15:39:55 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-03-31 15:46:54 +0200 |
| commit | 8370602f37ad6aa02485d85e5b179b76c3f15701 (patch) | |
| tree | 5a92ac70db1f791aae19a67b92da356c9ed4ed5a /src/components/atoms/headings/heading.stories.tsx | |
| parent | 351532e9906e32c862bf6810a3871993cde13ba2 (diff) | |
chore: add a Heading component
Diffstat (limited to 'src/components/atoms/headings/heading.stories.tsx')
| -rw-r--r-- | src/components/atoms/headings/heading.stories.tsx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/components/atoms/headings/heading.stories.tsx b/src/components/atoms/headings/heading.stories.tsx new file mode 100644 index 0000000..9958af9 --- /dev/null +++ b/src/components/atoms/headings/heading.stories.tsx @@ -0,0 +1,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', +}; |
