aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/buttons/back-to-top.stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/molecules/buttons/back-to-top.stories.tsx')
-rw-r--r--src/components/molecules/buttons/back-to-top.stories.tsx41
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',
+};