0e1b1e3579
* Add Typescript to Panel and Icon * Fix Icon component import * Convert packages/checkout/utils/validation/index to TypeScript * Convert checkout registry to TypeScript * Add return type to mustContain * Add TypeScript to Totals components from @woocommerce/blocks-checkout * Add TypeScript to @woocommerce/price-format * Use types from @woocommerce/type-defs when possible * Allow empty objects when loading * Fix formatting in payment-method-data-context.js * Add missing return types * Fix up price warnings * Fix more warnings in FormattedMonetaryAmount Co-authored-by: Raluca Stan <ralucastn@gmail.com> Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com> Co-authored-by: Mike Jolley <mike.jolley@me.com> |
||
---|---|---|
.. | ||
icon | ||
library | ||
stories | ||
README.md | ||
index.js | ||
tsconfig.json |
README.md
Icons
WooCommerce Blocks Icons Library.
Usage
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
Name | Type | Default | Description |
---|---|---|---|
size |
integer |
24 |
Size of icon in pixels. |
Adding Icons
- Add the icon file to
./library
folder. - Make sure to use
SVG
primitive from@wordpress/components
and not a native svg.SVG
offers more accessibility features. - Remove width and height since they're handled by Icon.
- Remove any hardcoded colors on the svg. If necessary, use
CurrentColor
. - Export the Icon in
./library/index.js
.