woocommerce/plugins/woocommerce-admin/docs/components/packages
Paul Sealock dfc428e176 Merge branch 'master' into release/0.18.0 2019-08-30 20:53:47 +12:00
..
README.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
advanced-filters.md Show separate documentation for filter components. 2019-08-27 10:20:38 -07: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
autocomplete.md Add Autocomplete component (https://github.com/woocommerce/woocommerce-admin/pull/2808) 2019-08-21 14:41:42 +08: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
compare-filter.md Show separate documentation for filter components. 2019-08-27 10:20:38 -07:00
count.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
date-range-filter-picker.md Show separate documentation for filter components. 2019-08-27 10:20:38 -07: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
filter-picker.md Show separate documentation for filter components. 2019-08-27 10:20:38 -07:00
filters.md Show separate documentation for filter components. 2019-08-27 10:20:38 -07:00
flag.md Release/v0.6.0 (https://github.com/woocommerce/woocommerce-admin/pull/1417) 2019-01-30 10:51:03 -08:00
form.md release 0.18.0 2019-08-28 16:01:13 +12: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 Merge branch 'master' into release/0.18.0 2019-08-30 20:53:47 +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 0.18.0 2019-08-28 16:01:13 +12: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.17.0 2019-08-15 13:43:22 +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
web-preview.md release 0.17.0 2019-08-15 13:43:22 +12: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>
  );
}