UNPKG

@storybook/html

Version:
51 lines (45 loc) 1.1 kB
import { createButton } from './Button'; // More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction export default { title: 'Example/Button', tags: ['autodocs'], render: ({ label, ...args }) => { // You can either use a function to create DOM elements or use a plain html string! // return `<div>${label}</div>`; return createButton({ label, ...args }); }, argTypes: { backgroundColor: { control: 'color' }, label: { control: 'text' }, onClick: { action: 'onClick' }, primary: { control: 'boolean' }, size: { control: { type: 'select' }, options: ['small', 'medium', 'large'], }, }, }; // More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args export const Primary = { args: { primary: true, label: 'Button', }, }; export const Secondary = { args: { label: 'Button', }, }; export const Large = { args: { size: 'large', label: 'Button', }, }; export const Small = { args: { size: 'small', label: 'Button', }, };