0.0.1-alpha.0 • Published 5 months ago
playbook-icons-react v0.0.1-alpha.0
React Icons
playbook-icons
is an open source package that exports these icons as React.js components that can be used in all of your React projects.
Installation
yarn add playbook-icons
or
npm i playbook-icons
Usage
import React from 'react';
import { Powergon } from 'playbook-icons';
const App = () => {
return <Powergon />
};
export default App;
Icons can take any standard SVG properties as optional props, e.g.
<Powergon color="red" height={36} width={36} />
Default values for the most common props are given below:
Prop name | Default value |
---|---|
color | "currentColor" |
width | "1.5em" |
height | "1.5em" |
strokeWidth | 1.5 |
IconsProvider
Tired of specifying the same props for every single icon, every time you use them? So were we. Use the Playbook IconsProvider to set the default icon props for everything inside IconsProvider.
import { IconsProvider, Check } from 'playbook-icons'
return (
<IconsProvider
iconProps={{
color: '#AAAAAA',
strokeWidth: 1,
width: '1em',
height: '1em',
}}
>
<SomeOtherContainer>
<Check />
</SomeOtherContainer>
</IconsProvider>
)
0.0.1-alpha.0
5 months ago