1.1.2 • Published 6 years ago

react-power-path v1.1.2

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

react-power-path

npm npm Build Status Coverage Status cdn

enhanced <path /> that recieve its totalLength via specific styles.

Installation

yarn add react-power-path

Usage

import React from 'react'
import Path from 'react-power-path'

export default (props) => (
  <svg viewBox='0 0 300 300'>
    <g>
      <Path {...{
        d: 'M 100 100 L 300 100 L 200 300 z',
        style: {
          strokeDasharray: (totalLength) => {},
          strokeDashoffset: (totalLength) => {},
          animation: (totalLength) => {},
          animationName: (totalLength) => {},
        }
      }} />
    </g>
  </svg>
)

API

specific styles:

  • strokeDasharray
  • strokeDashoffset
  • animation
  • animationName

If they are set as function, the totalLength passed, and the result will be value. Or set as values, nothing happens.

react-power-path depend on createElementNS and path.getTotalLength.

License

MIT (http://opensource.org/licenses/MIT)

1.1.2

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago