svg-fill-custom
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

svg-fill-custom

Svg custom fill color, stroke, padding and more

NPM JavaScript Style Guide

Demo: https://duongdam.github.io/svg-fill-custom/

Install

yarn add svg-fill-custom

npm install --save svg-fill-custom

Usage

import { SVGCustom } from 'svg-fill-custom';


<SVGCustom src={<TestSvg />} fill={'red'} width={'200px'} />

Example

import React from 'react'
import { ReactComponent as TestSvg } from "./copy.svg";
import { SVGCustom } from 'svg-fill-custom'
import styled from "styled-components";

interface ComponentProps {
  width?: string
  height?: string
}

const DivRoot = styled.div<ComponentProps>`
  display: flex;
  justify-content: center;
  align-items: center;
`

const App = () => {
  return (
    <DivRoot>
      <SVGCustom src={<TestSvg />} fill={'red'} width={'200px'} />
      <SVGCustom src={<TestSvg />} fill={'#3cdc18'} width={'200px'} />
      <SVGCustom src={<TestSvg />} fill={'#d00cde'} width={'200px'} />
      <SVGCustom src={<TestSvg />} fill={'#fa5d07'} width={'200px'} />
      <SVGCustom src={<TestSvg />} fill={'#07dcc3'} width={'200px'} />
    </DivRoot>
  )
}

export default App

License

MIT © duongdam

Package Sidebar

Install

npm i svg-fill-custom

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

481 kB

Total Files

9

Last publish

Collaborators

  • duong.dkp