2.0.9 • Published 5 days ago

@newhighsco/storybook-addon-svgr v2.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
5 days ago

storybook-addon-svgr NPM version

Storybook addon for transforming SVGs into React components using SVGR

Installation

Install Storybook and @newhighsco/storybook-addon-svgr:

yarn add -D storybook @newhighsco/storybook-addon-svgr @storybook/react-webpack5

Usage

Create a .storybook/main.js in your project:

// .storybook/main.js
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const config = {
  framework: '@storybook/react-webpack5',
  addons: [
    {
      name: '@newhighsco/storybook-addon-svgr',
      options: {
        svgrOptions: {
          /* config options here */
        }
      }
    }
  ]
}

export default config

In your code:

import starUrl, { ReactComponent as Star } from './star.svg'

const App = () => (
  <>
    <img src={starUrl} alt="star" />
    <Star />
  </>
)

Options

See options supported by SVGR. Alternatively create a SVGR configuration file in your project:

CHANGELOG

2.0.9

5 days ago

2.0.8

18 days ago

2.0.7

29 days ago

2.0.6

29 days ago

2.0.5

1 month ago

2.0.4

1 month ago

2.0.3

2 months ago

2.0.2

2 months ago

2.0.1

2 months ago

2.0.0

2 months ago

1.0.22

3 months ago

1.0.21

3 months ago

1.0.20

3 months ago

1.0.19

4 months ago

1.0.18

4 months ago

1.0.17

4 months ago

1.0.16

4 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago