Skip to content
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

Open
natterstefan opened this issue Apr 26, 2021 · 1 comment
Open

Storybook - Essential Addons Setup #22

natterstefan opened this issue Apr 26, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@natterstefan
Copy link
Owner

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.

@natterstefan natterstefan added the enhancement New feature or request label Apr 26, 2021
@natterstefan natterstefan self-assigned this Apr 26, 2021
@natterstefan
Copy link
Owner Author

natterstefan commented Nov 27, 2021

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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant