2020-01-31 18:20:33 +00:00
|
|
|
# Icons
|
|
|
|
|
|
|
|
WooCommerce Blocks Icons Library.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
import { Icon, bill, woo } from '@woocommerce/icons';
|
|
|
|
|
|
|
|
<Icon srcElement={ bill } />
|
|
|
|
|
|
|
|
<Icon srcElement={ bill } size={ 16 } />
|
|
|
|
|
|
|
|
<Icon srcElement={ woo } width={ 20 } height={ Math.floor( 20 * 1.67 ) } />
|
|
|
|
```
|
|
|
|
|
|
|
|
## Props
|
|
|
|
|
2021-08-05 09:26:00 +00:00
|
|
|
| Name | Type | Default | Description |
|
|
|
|
| ------ | --------- | ------- | ----------------------- |
|
|
|
|
| `size` | `integer` | `24` | Size of icon in pixels. |
|
2020-01-31 18:20:33 +00:00
|
|
|
|
|
|
|
## Adding Icons
|
|
|
|
|
|
|
|
1. Add the icon file to `./library` folder.
|
2021-08-05 09:26:00 +00:00
|
|
|
2. Make sure to use `SVG` primitive from `wordpress-components` and not a native svg. `SVG` offers more accessibility features.
|
2020-01-31 18:20:33 +00:00
|
|
|
3. Remove width and height since they're handled by Icon.
|
|
|
|
4. Remove any hardcoded colors on the svg. If necessary, use `CurrentColor`.
|
2021-08-05 09:26:00 +00:00
|
|
|
5. Export the Icon in `./library/index.js`.
|