Created
April 29, 2019 00:11
-
-
Save phobon/b460f308084586577c3a1ec37b080929 to your computer and use it in GitHub Desktop.
Custom template to use for streamline icons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// default template | |
module.exports = ({ | |
name, | |
viewBox, | |
pathData | |
}) => `import React from 'react' | |
const ${name}Icon = ({ | |
size, | |
color, | |
...props | |
}) => ( | |
<svg | |
{...props} | |
viewBox='${viewBox}' | |
width={size} | |
height={size} | |
stroke={color} | |
> | |
<path d='${pathData}' /> | |
</svg> | |
) | |
${name}Icon.displayName = '${name}Icon' | |
${name}Icon.defaultProps = { | |
size: 24, | |
color: 'currentcolor' | |
strokeWidth: 2, | |
strokeLinecap: 'round', | |
strokeLinejoin: 'round', | |
fill: 'none', | |
} | |
export default ${name}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment