react-line-awesome-svg

Use line-awesome as react svg component

Usage no npm install needed!

<script type="module">
  import reactLineAwesomeSvg from 'https://cdn.skypack.dev/react-line-awesome-svg';
</script>

README

react-svg-line-awesome

This project is about create React Svg Components using Line Awesome assets.

See the list of all icons available

How to build?

npx @svgr/cli --icon  ./node_modules/line-awesome/svg/*.svg --out-dir ./src/icons
find ./src/icons -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.tsx"' {} \;
sed -i 's/[(]props[)]/\(props\: JSX\.IntrinsicAttributes \& React\.SVGProps\<SVGSVGElement\>\)/g' *
sh prebuild.sh

How to install?

# npm
npm install react-line-awesome-svg --save

# yarn
yarn add react-line-awesome-svg

How to use?

import { LineAwesome } from 'react-line-awesome-svg'
import SvgThumbsUp from 'react-line-awesome-svg/icons/ThumbsUp'

<LineAwesome
    icon={SvgThumbsUp}
    className="my-svg"
    fill="#000"
/>

// outputs -> <svg class="my-svg" fill="#000" />