5db5c8b110
* Add tour-kit component * Add @types/wordpress__viewport to @woocommerce/components devDeps * Add tour-kit README.md * Add primaryButtonText option to tour kit step meta * Add changelog * Remove unneeded style import * Set position and z-index style for tour-kit * Add disable primary button feature for tour kit * Export TourKitTypes * Update style-build config for @automattic/* packages * Add @automattic/* deps for components * Ignore fs in webpack.config.js * Update tour-kit stories * Add tour-kit tests * Update tour-kit README.md * Update tour-kit types * Update webpack.config.js * Update style.scss * Add auto focus feature * Update type doc |
||
---|---|---|
.. | ||
changelog | ||
src | ||
.eslintrc.js | ||
.npmrc | ||
CHANGELOG.md | ||
README.md | ||
composer.json | ||
composer.lock | ||
jest.config.json | ||
package.json | ||
project.json | ||
tsconfig-cjs.json | ||
tsconfig.json | ||
webpack.config.js |
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
.