woocommerce/packages/js/components
jonathansadowski d48a0b2d90
Add helper tool for making sure build, lint, and test are run through Turborepo (#33573)
* Add helper tool for making sure build, lint, and test are run through Turborepo

* Update node version for require-turbo
2022-06-28 13:17:05 -05:00
..
changelog Add helper tool for making sure build, lint, and test are run through Turborepo (#33573) 2022-06-28 13:17:05 -05:00
src Add new flow shipping recommendation task (#33620) 2022-06-28 13:53:03 +08:00
.eslintrc.js Add .eslintrc config to each packages 2022-03-29 16:08:07 +08:00
.gitignore Update JS packages changelogs (#33412) 2022-06-16 10:06:31 +12:00
.npmrc Moved WCA Packages 2022-03-18 14:25:26 -07:00
CHANGELOG.md @woocommerce/components: Prep changelog for release (#33359) 2022-06-14 14:21:02 +12:00
PREVIOUS_CHANGELOG.md @woocommerce/components: Prep changelog for release (#33359) 2022-06-14 14:21:02 +12:00
README.md Moved WCA Packages 2022-03-18 14:25:26 -07:00
composer.json Add PR numbers to changelog entries on code freeze process (#33627) 2022-06-28 11:15:39 -07:00
composer.lock Add PR numbers to changelog entries on code freeze process (#33627) 2022-06-28 11:15:39 -07:00
jest.config.json Prefixed Private JS Packages (#33218) 2022-05-31 15:42:00 -07:00
package.json Add helper tool for making sure build, lint, and test are run through Turborepo (#33573) 2022-06-28 13:17:05 -05:00
tsconfig-cjs.json Added EOF Newlines 2022-05-10 13:35:31 -07:00
tsconfig.json Moved WCA Packages 2022-03-18 14:25:26 -07:00
webpack.config.js Prefixed Private JS Packages (#33218) 2022-05-31 15:42:00 -07: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

pnpm 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.