2.0.60 • Published 7 months ago

@newhighsco/storybook-addon-svgr v2.0.60

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months 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.37

1 year ago

2.0.38

1 year ago

2.0.35

1 year ago

2.0.36

1 year ago

2.0.34

1 year ago

2.0.39

12 months ago

2.0.48

9 months ago

2.0.49

9 months ago

2.0.46

10 months ago

2.0.47

9 months ago

2.0.44

10 months ago

2.0.45

10 months ago

2.0.42

10 months ago

2.0.43

10 months ago

2.0.40

11 months ago

2.0.41

10 months ago

2.0.59

8 months ago

2.0.57

8 months ago

2.0.58

8 months ago

2.0.55

8 months ago

2.0.56

8 months ago

2.0.53

9 months ago

2.0.54

9 months ago

2.0.51

9 months ago

2.0.52

9 months ago

2.0.50

9 months ago

2.0.60

7 months ago

2.0.33

1 year ago

2.0.32

1 year ago

2.0.31

1 year ago

2.0.29

1 year ago

2.0.30

1 year ago

2.0.28

1 year ago

2.0.26

1 year ago

2.0.27

1 year ago

2.0.25

1 year ago

2.0.15

2 years ago

2.0.16

1 year ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.12

2 years ago

2.0.19

1 year ago

2.0.17

1 year ago

2.0.18

1 year ago

2.0.24

1 year ago

2.0.22

1 year ago

2.0.23

1 year ago

2.0.20

1 year ago

2.0.21

1 year ago

2.0.11

2 years ago

2.0.10

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago