1.0.3 • Published 1 year ago

@figma-extractor/transform-to-jsx v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

@figma-extractor/transform-to-jsx

Parses svg with babel and prepare for using inside JSX components (See example above) – renames attributes to camelCase, removes extra attributes etc. Allows to customize behaviour using Plugins api

import { transformToJsx } from '@figma-extractor/transform-to-jsx'

nodes
    .map((node) => transformToJsx(node))
    .forEach((node) => {
        // node.jsxContent
    })

Exports

  • transformToJsx(node: Node, extraPlugins: Plugin[] = [])
  • svgAttributes(fn: AttributesFn): Plugin for adding extra attributes to svg's root element

Types

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago