npm.io
1.4.7 • Published 8 years ago

react-svg-textures

Licence
MIT
Version
1.4.7
Deps
4
Size
311 kB
Vulns
0
Weekly
0
Stars
32

react-svg-textures

npm version

Textures.js ported to React. Fully isomorphic.

Example

import React from 'react'
import { render } from 'react-dom';
import { Lines } from 'react-svg-textures';

render((
  <svg width={200} height={200}>
    <Lines
      id='pattern'
      strokeWidth={10}
      stroke='purple'
      size={10}
      orientation='diagonal'
      background='blue'
    />
    <circle cx={100} cy={100} r={5} fill='url(#pattern)' />
  </svg>
), container);

Components

Lines
import { Lines } from 'react-svg-textures`;
Prop Type
size number
strokeWidth number
orientation string
shapeRendering string
stroke string
background string
id string
Circles
import { Circles } from 'react-svg-textures`;
Prop Type
size number
strokeWidth number
stroke string
background string
id string
complement bool
radius number
Paths
import { Paths } from 'react-svg-textures`;
Prop Type
size: number
d enum( 'squares', 'nylon', 'waves', 'woven', 'caps', 'crosses', 'hexagons') OR function(size) => string
strokeWidth number
shapeRendering string
stroke string
background string
id string

Keywords