Skip to content

Instantly share code, notes, and snippets.

@phobon
Created April 29, 2019 00:11
Show Gist options
  • Save phobon/b460f308084586577c3a1ec37b080929 to your computer and use it in GitHub Desktop.
Save phobon/b460f308084586577c3a1ec37b080929 to your computer and use it in GitHub Desktop.
Custom template to use for streamline icons
// 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