Pure SVG Icons for IconPark
Please visit IconPark Website
npm install @icon-park/svg --save
Import an icon from @icon-park/svg
and then call it:
import {Home} from '@icon-park/svg';
// examples
const svg = Home({theme: 'outline'});
console.log(svg);
You can use the static methods setConfig
in @icon-park/svg
to set the default config globally:
import {setConfig} from '@icon-park/svg'
setConfig({
theme: 'outline',
size: '1em',
strokeWidth: 4,
strokeLinecap: 'round',
strokeLinejoin: 'round',
outStrokeColor: '#000',
outFillColor: '#2F88FF',
innerStrokeColor: '#FFF',
innerFillColor: '#43CCF8'
})
You can use babel-plugin-import to import icons on demand.
Set config like this:
{
"plugins": [
[
"import",
{
"libraryName": "@icon-park/svg",
"libraryDirectory": "es/icons",
"camel2DashComponentName": false
}
]
]
}
| prop | description | type | default | note | | āāā- | ā | ā | ā | ā | | theme | Theme of the icons. | āoutlineā | āfilledā | ātwo-toneā | āmulti-colorā | āoutlineā | | size | The width/height of the icon | number | string | ā1emā | | spin | Rotate icon with animation | boolean | false | | fill | Colors of theme | string | string[] | ācurrentColorā | | strokeLinecap | the stroke-linecap prop of svg element | ābuttā | āroundā | āsquareā | āroundā | | strokeLinejoin | the stroke-linejoin prop of svg element | āmiterā | āroundā | ābevelā | āroundā | | strokeWidth | the stroke-width prop of svg element | number | 4 |