1.2.0 • Published 4 years ago

storybook-states v1.2.0

Weekly downloads
746
License
MIT
Repository
github
Last release
4 years ago

storybook-states

Visually drive out component states in Storybook

semantic-release npm Build Status

What is this?

Wrap your component and use an array of states to drive out different variations in Storybook.

Installation

yarn add storybook-states

Usage

export const Example = () => (
  <States<ButtonProps>
    states={[
      {},
      { children: "Goodbye" },
      { outlined: true },
      { outlined: false }
    ]}
  >
    <Button onClick={action("clicked")}>Hello</Button>
  </States>
);

Example

View the example stories for more usage details.

Interface

const States: <T>({
  states,
  children,
  styles,
  ...rest
}: Props<T>) => JSX.Element;
1.2.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago