@storybook/cli
Version:
Storybook's CLI - easiest method of adding storybook to your projects
42 lines (35 loc) • 1.03 kB
JSX
/** @jsx h */
import { h } from 'preact';
import { Button } from './Button';
// More on default export: https://storybook.js.org/docs/preact/writing-stories/introduction#default-export
export default {
title: 'Example/Button',
component: Button,
// More on argTypes: https://storybook.js.org/docs/preact/api/argtypes
argTypes: {
backgroundColor: { control: 'color' },
onClick: { action: 'onClick' },
},
};
// More on component templates: https://storybook.js.org/docs/preact/writing-stories/introduction#using-args
const Template = (args) => <Button {...args} />;
export const Primary = Template.bind({});
// More on args: https://storybook.js.org/docs/preact/writing-stories/args
Primary.args = {
primary: true,
label: 'Button',
};
export const Secondary = Template.bind({});
Secondary.args = {
label: 'Button',
};
export const Large = Template.bind({});
Large.args = {
size: 'large',
label: 'Button',
};
export const Small = Template.bind({});
Small.args = {
size: 'small',
label: 'Button',
};