Norway Porridge Makers

    @snek-at/storybook-addon-chakra-ui
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.0 • Public • Published

    @chakra-ui/storybook-addon

    Use Chakra UI in your Storybook stories.

    Wraps each of your stories with ChakraProvider which can be configured using Storybook parameters.

    Demo

    https://user-images.githubusercontent.com/52858351/164954327-5e395475-f9e5-4569-83e7-fcf3394d9567.mov

    Installation

    yarn

    yarn add -D @snek-at/storybook-addon-chakra-ui

    npm

    npm i -D @snek-at/storybook-addon-chakra-ui

    Add the addon to your configuration in .storybook/main.js:

    module.exports = {
      addons: ['@snek-at/storybook-addon-chakra-ui']
    }

    Configuring ChakraProvider

    If you need to customize the props passed to ChakraProvider for your stories (to use a custom theme, for example), you'll need to create custom Storybook parameters.

    To set global parameters for this addon, add a chakra object to the parameters export in .storybook/preview.js:

    import myTheme from '../theme'
    export const parameters = {chakra: {theme: myTheme}}

    The chakra parameters take the same shape as the props for ChakraProvider. See the ChakraProvider props table to see the list of possible parameters.

    Overriding ChakraProvider configuration for individual components or stories

    Storybook allows you to define parameters at multiple levels: global, component, and story. We recommend setting default parameters at the global level, and overriding them at the component or story when necessary. See the Storybook Parameters documentation for more information.

    Keywords

    none

    Install

    npm i @snek-at/storybook-addon-chakra-ui

    DownloadsWeekly Downloads

    2,976

    Version

    1.1.0

    License

    EUPL-1.2

    Unpacked Size

    28 kB

    Total Files

    22

    Last publish

    Collaborators

    • snek-at