woocommerce/plugins/woocommerce-admin/docs/components/packages
renovate[bot] 212e030e92 Update dependency recast to v0.17.5 (https://github.com/woocommerce/woocommerce-admin/pull/2105)
* Update dependency recast to v0.17.5

* Run `npm run docs`
2019-04-24 15:40:41 -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 Update dependency recast to v0.17.5 (https://github.com/woocommerce/woocommerce-admin/pull/2105) 2019-04-24 15:40:41 -04: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/0.9.0 (https://github.com/woocommerce/woocommerce-admin/pull/1921) 2019-03-28 11:30:57 -07: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/v0.8.0 (https://github.com/woocommerce/woocommerce-admin/pull/1710) 2019-02-27 16:43:39 -08: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 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-list-control.md Update dependency recast to v0.17.5 (https://github.com/woocommerce/woocommerce-admin/pull/2105) 2019-04-24 15:40:41 -04: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 Update text domain. (https://github.com/woocommerce/woocommerce-admin/pull/1795) 2019-03-13 11:14:02 -06:00
table.md Release/0.9.0 (https://github.com/woocommerce/woocommerce-admin/pull/1921) 2019-03-28 11:30:57 -07: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>
  );
}