1.4.7 • Published 6 years ago

react-svg-textures v1.4.7

Weekly downloads
19
License
MIT
Repository
github
Last release
6 years ago

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`;
PropType
sizenumber
strokeWidthnumber
orientationstring
shapeRenderingstring
strokestring
backgroundstring
idstring

Circles

import { Circles } from 'react-svg-textures`;
PropType
sizenumber
strokeWidthnumber
strokestring
backgroundstring
idstring
complementbool
radiusnumber

Paths

import { Paths } from 'react-svg-textures`;
PropType
size: number
denum( 'squares', 'nylon', 'waves', 'woven', 'caps', 'crosses', 'hexagons') OR function(size) => string
strokeWidthnumber
shapeRenderingstring
strokestring
backgroundstring
idstring