Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@newhighsco/storybook-addon-svgr

Package Overview
Dependencies
Maintainers
0
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@newhighsco/storybook-addon-svgr

Storybook addon for transforming SVGs into React components using SVGR

  • 2.0.39
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8K
decreased by-30.08%
Maintainers
0
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 05 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc