• Version 6.2.0
  • Published
  • 25 kB
  • No dependencies
  • MIT license


npm i @svgr/babel-plugin-transform-svg-component
yarn add @svgr/babel-plugin-transform-svg-component
pnpm add @svgr/babel-plugin-transform-svg-component


Transform SVG into component



function plugin

plugin: (
_: ConfigAPI,
opts: Options
) => { visitor: { Program(path: NodePath<types.Program>): void } };


    interface Options

    interface Options {}

      property expandProps

      expandProps?: boolean | 'start' | 'end';

        property exportType

        exportType?: 'named' | 'default';

          property importSource

          importSource?: string;

            property jsxRuntime

            jsxRuntime?: 'automatic' | 'classic';

              property jsxRuntimeImport

              jsxRuntimeImport?: JSXRuntimeImport;

                property memo

                memo?: boolean;

                  property namedExport

                  namedExport?: string;

                    property native

                    native?: boolean;

                      property ref

                      ref?: boolean;

                        property state

                        state: State;

                          property template

                          template?: Template;

                            property titleProp

                            titleProp?: boolean;

                              property typescript

                              typescript?: boolean;

                                interface Template

                                interface Template {}

                                  call signature

                                  (variables: TemplateVariables, context: TemplateContext):
                                  | types.Statement
                                  | types.Statement[];

                                    Package Files (1)

                                    Dependencies (0)

                                    No dependencies.

                                    Dev Dependencies (0)

                                    No dev dependencies.

                                    Peer Dependencies (1)


                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@svgr/babel-plugin-transform-svg-component.

                                    • Markdown
                                    • HTML
                                      <a href="https://www.jsdocs.io/package/@svgr/babel-plugin-transform-svg-component"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>