-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storybook - Essential Addons Setup #22
Labels
enhancement
New feature or request
Comments
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',
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: