woocommerce/plugins/woocommerce-admin/packages/components
renovate[bot] 302c7f95e4 Update dependency dompurify to v2.2.9 (https://github.com/woocommerce/woocommerce-admin/pull/7100)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-06-03 14:11:24 +12:00
..
src Refactor and extract inbox panel components (https://github.com/woocommerce/woocommerce-admin/pull/7006) 2021-06-02 15:25:41 -03:00
.npmrc Build: Move components to packages dir (https://github.com/woocommerce/woocommerce-admin/pull/804) 2018-11-15 13:16:23 -05:00
CHANGELOG.md Fix advanced filter operator selector styling. (https://github.com/woocommerce/woocommerce-admin/pull/7005) 2021-05-26 15:53:45 -04:00
README.md Add tree shaking support for woocommerce components (https://github.com/woocommerce/woocommerce-admin/pull/7034) 2021-05-26 16:35:46 -03:00
package.json Update dependency dompurify to v2.2.9 (https://github.com/woocommerce/woocommerce-admin/pull/7100) 2021-06-03 14:11:24 +12:00

README.md

Components

This packages includes a library of components that can be used to create pages in the WooCommerce dashboard and reports pages.

Installation

Install the module

npm install @woocommerce/components --save

View the full Component documentation for usage information.

Usage

/**
 * Woocommerce dependencies
 */
import { Card } from '@woocommerce/components';

export default function MyCard() {
	return (
		<Card title="Store Performance" description="Key performance metrics">
			<p>Your stuff in a Card.</p>
		</Card>
	);
}

Many components include CSS to add style, you will need to add in order to appear correctly. Within WooCommerce, add the wc-components stylesheet as a dependency of your plugin's stylesheet. See wp_enqueue_style documentation for how to specify dependencies.

In non-WordPress projects, link to the build-style/card/style.css file directly, it is located at node_modules/@woocommerce/components/build-style/<component_name>/style.css.