storybook-storygrid
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Storybook Storygrid

This Storygrid is an addition to the storybook tool, which allows you to use grids. These Storygrids help structure elements in the preview.

Getting Started

Install package:

npm i storybook-storygrid

Simple example story:

import React from 'react';
import { StyleGrid } from 'storybook-storygrid';

export const Overview = () => (
  <StyleGrid>
    Default
    <Button text="Button Text" />
    <Button text="Button Text" disabled />
  </StyleGrid>
);

Nesting of Storygrids:

import React from 'react';
import { StyleGrid } from 'storybook-storygrid';
import { MyComponent } from 'pathto/MyComponent';

export const Overview = () => (
  <StyleGrid>
    <StyleGrid>
      Not expanded
      <MyComponent expanded={false} />
      Expanded
      <MyComponent expanded={true} />
    </StyleGrid>
    <StyleGrid>
      Styled
      <MyComponent
        expanded={true}
        style={{
          background: 'red',
        }}
      />
    </StyleGrid>
  </StyleGrid>
);

Crop Marks

By default the Crop Marks are being displayed.

Screenshot of a storybook with Storygrid and Crop Marks.

Disable Crop Marks

You can disable them by deleting following line in the StyleGrid/index.tsx file:

<CropMarks forceShowSizes={showSizes}>{child}</CropMarks>

Readme

Keywords

Package Sidebar

Install

npm i storybook-storygrid

Weekly Downloads

13

Version

1.0.0

License

MIT

Unpacked Size

76.6 kB

Total Files

24

Last publish

Collaborators

  • ubitec