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

storybook-preset-inline-svg

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-preset-inline-svg

Storybook preset to load SVG files inline

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.7K
increased by26.29%
Maintainers
1
Weekly downloads
 
Created
Source

Storybook Preset Inline SVG

A Storybook preset to load SVG files inline using svg-inline-loader.

Basic Usage

First npm install storybook-preset-inline-svg

Then update one of the following files based on your Storybook setup:

  • .storybook/main.js

    module.exports = {
        addons: ['storybook-preset-inline-svg']
    }
    
  • .storybook/presets.js

    module.exports = ['storybook-preset-inline-svg']
    

Advanced Usage

By default this preset will inline all SVG files. You can use these options to filter which SVG files are inlined or to pass options along to svg-inline-loader.

None of the options are required. Only use one of include or exclude, not both.

  • svgInlineLoaderOptions options supported by svg-inline-loader
  • include sets which files will be inlined. Only RegExp and Function are supported. See Webpack's include.
  • exclude sets which files will not be inlined. Only RegExp and Function are supported. See Webpack's exclude.

For example,

module.exports = {
  addons: [
    {
      name: 'storybook-preset-inline-svg',
      options: {
        include: /source\/.+\.svg$/,
        svgInlineLoaderOptions: {
          removeTags: true,
          removingTags: ['circle']
        }
      }
    }
  ]
}

Keywords

FAQs

Package last updated on 21 Aug 2021

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