react-power-path
v1.1.2
Published
enhanced <path /> that recieve its totalLength
Readme
react-power-path
enhanced <path /> that recieve its totalLength via specific styles.
Installation
yarn add react-power-pathUsage
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:
strokeDasharraystrokeDashoffsetanimationanimationName
If they are set as function, the totalLength passed, and the result will be value. Or set as values, nothing happens.
react-power-pathdepend oncreateElementNSandpath.getTotalLength.
License
MIT (http://opensource.org/licenses/MIT)
