Open natterstefan opened 3 years ago
And improve typings of stories:
// src: https://storybook.js.org/docs/react/get-started/whats-a-story/
// Button.stories.ts|tsx
import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { Button, ButtonProps } from './Button';
export default {
/* ๐ The title prop is optional.
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
} as ComponentMeta<typeof Button>;
//๐ We create a โtemplateโ of how args map to rendering
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;
export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: 'Button',
};
Feature Request
Add more essential addons to the current setup (e.g. nextjs router, data handling as soon as we add #12 for instance).
Basic example
Motivation
Make it easier for starters to use Storybook and make the most out of it.