procyon/stories/components/Button/Button.storiesX.tsx

32 lines
679 B
TypeScript
Raw Normal View History

2021-07-05 17:38:18 +02:00
import React from 'react';
import { action } from '@storybook/addon-actions';
2021-07-05 17:38:18 +02:00
import { Meta, Story } from '@storybook/react';
import Button, { ButtonType } from '@treejs/components/Button';
const Template: Story<ButtonType> = (args) => <Button {...args} />;
export const Default = Template.bind({});
Default.args = {
label: 'Button',
onClick: action('clicked'),
};
export const WithElement = Template.bind({});
WithElement.args = {
label: <b>Element</b>,
onClick: action('clicked'),
2021-07-05 17:38:18 +02:00
};
export default {
title: 'Components/Button',
component: Button,
parameters: {
layout: 'centered',
docs: {
page: require('./Button.stories.mdx').default,
},
},
2021-07-05 17:38:18 +02:00
} as Meta;