woocommerce/plugins/woocommerce-admin/docs/components/packages
Justin Shreve e81b1fd776 Add `help` prop to SimpleSelectControl to properly show errors. (https://github.com/woocommerce/woocommerce-admin/pull/2751) 2019-08-08 09:10:47 -04: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 Update dependency recast to v0.17.5 (https://github.com/woocommerce/woocommerce-admin/pull/2105) 2019-04-24 15:40:41 -04:00
calendar.md release 0.12.0 2019-05-15 11:59:40 +12:00
card.md Release 0.13.0 2019-06-13 10:55:19 +12:00
chart.md Release 0.13.0 2019-06-13 10:55:19 +12: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 release 0.12.0 2019-05-15 11:59:40 +12:00
empty-content.md Release/0.9.0 (https://github.com/woocommerce/woocommerce-admin/pull/1921) 2019-03-28 11:30:57 -07:00
filters.md Prep for release 0.15.0 (https://github.com/woocommerce/woocommerce-admin/pull/2641) 2019-07-12 14:27:18 -07: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
list.md release 0.16.0 prep 2019-07-24 12:30:29 +12: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-list-control.md Prep for release 0.15.0 (https://github.com/woocommerce/woocommerce-admin/pull/2641) 2019-07-12 14:27:18 -07: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
simple-select-control.md Add `help` prop to SimpleSelectControl to properly show errors. (https://github.com/woocommerce/woocommerce-admin/pull/2751) 2019-08-08 09:10:47 -04:00
spinner.md Release 0.13.0 2019-06-13 10:55:19 +12:00
split-button.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
stepper.md Release 0.13.0 2019-06-13 10:55:19 +12:00
summary.md Update text domain. (https://github.com/woocommerce/woocommerce-admin/pull/1795) 2019-03-13 11:14:02 -06:00
table.md release 0.16.0 prep 2019-07-24 12:30:29 +12: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>
  );
}