woocommerce/plugins/woocommerce-admin/docs/components/packages
Timmy Crawford 610f179679 Release v0.7.0 (https://github.com/woocommerce/woocommerce-admin/pull/1551)
* Bumping version to 0.7.0 and updating docs.

* updates to package-lock.json
2019-02-14 09:24:02 -08:00
..
README.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
animation-slider.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
calendar.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
card.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
chart.md Release v0.7.0 (https://github.com/woocommerce/woocommerce-admin/pull/1551) 2019-02-14 09:24:02 -08:00
count.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
date.md Release v0.5.0 (https://github.com/woocommerce/woocommerce-admin/pull/1319) 2019-01-16 08:24:45 -08:00
dropdown-button.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
ellipsis-menu.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
empty-content.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
filters.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
flag.md Release/v0.6.0 (https://github.com/woocommerce/woocommerce-admin/pull/1417) 2019-01-30 10:51:03 -08:00
gravatar.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
image-asset.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
link.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
order-status.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
pagination.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
product-image.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
rating.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
search.md Release v0.7.0 (https://github.com/woocommerce/woocommerce-admin/pull/1551) 2019-02-14 09:24:02 -08:00
section-header.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
section.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
segmented-selection.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
split-button.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
summary.md Release/v0.6.0 (https://github.com/woocommerce/woocommerce-admin/pull/1417) 2019-01-30 10:51:03 -08:00
table.md Release v0.7.0 (https://github.com/woocommerce/woocommerce-admin/pull/1551) 2019-02-14 09:24:02 -08:00
tag.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
text-control-with-affixes.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
view-more-list.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00

README.md

Package Components

This folder contains the WooCommerce-created components. These are exported onto a global, wc.components, for general use.

How to use:

For any files not imported into components/index.js (analytics/*, layout/*, dashboard/*, etc), we can use import { Card, etc … } from @woocommerce/components.

For any component/* files, we should import from component-specific paths, not from component/index.js, to prevent circular dependencies. See components/card/index.js for an example.

import { Card, Link } from '@woocommerce/components';

render: function() {
  return (
    <Card title="Card demo">
      Card content with an <Link href="/">example link.</Link>
    </Card>
  );
}

For external development

External developers will need to enqueue the components library, wc-components, and then can access them from the global.

const { Card, Link } = wc.components;

render: function() {
  return (
    <Card title="Card demo">
      Card content with an <Link href="/">example link.</Link>
    </Card>
  );
}