bpk-storybook-utils

v2.1.2
Backpack storybook-utils component.

bpk-storybook-utils

This package contains convenience utilities for use with storybook.

Installation

npm install bpk-storybook-utils --save-dev

Included utilities

action

action uses @storybook/addon-actions if available. If the module is not available, it will fall back to console.log instead. This makes it possible to use the action both within and without environments using storybook.

Usage

import { action } from 'bpk-storybook-utils';

...

action("Thing");

BpkDarkExampleWrapper

Adds a dark background, useful for displaying components that don't appear on a light background.

Usage

import { BpkDarkExampleWrapper } from 'bpk-storybook-utils';

...

<BpkDarkExampleWrapper>
  <p style={{ color: 'white' }}>
    This white text is only visible on dark backgrounds.
  </p>
</BpkDarkExampleWrapper>
npm i bpk-storybook-utils

Metadata

  • Apache-2.0
  • Whatever
  • Backpack Design System
  • released 9/30/2022

Downloads