diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-01 19:03:42 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-01 22:58:18 +0200 |
| commit | d177e0c7c61845b516d4a361a21739bb6486b9b5 (patch) | |
| tree | 3905aab133889d5d59f8116fbcf301930b858887 /src/components/molecules/buttons/back-to-top.stories.tsx | |
| parent | 163f9dc0fe436b708de4e59999e87005c6685a0f (diff) | |
chore: add a back to top component
Diffstat (limited to 'src/components/molecules/buttons/back-to-top.stories.tsx')
| -rw-r--r-- | src/components/molecules/buttons/back-to-top.stories.tsx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/components/molecules/buttons/back-to-top.stories.tsx b/src/components/molecules/buttons/back-to-top.stories.tsx new file mode 100644 index 0000000..f1a36e5 --- /dev/null +++ b/src/components/molecules/buttons/back-to-top.stories.tsx @@ -0,0 +1,41 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react'; +import { IntlProvider } from 'react-intl'; +import BackToTopComponent from './back-to-top'; + +export default { + title: 'Molecules/Buttons', + component: BackToTopComponent, + argTypes: { + additionalClasses: { + control: { + type: 'text', + }, + description: 'Add additional classes to the button wrapper.', + type: { + name: 'string', + required: false, + }, + }, + target: { + control: { + type: 'text', + }, + description: 'An element id (without hashtag) to use as anchor.', + type: { + name: 'string', + required: true, + }, + }, + }, +} as ComponentMeta<typeof BackToTopComponent>; + +const Template: ComponentStory<typeof BackToTopComponent> = (args) => ( + <IntlProvider locale="en"> + <BackToTopComponent {...args} /> + </IntlProvider> +); + +export const BackToTop = Template.bind({}); +BackToTop.args = { + target: 'top', +}; |
