woocommerce/plugins/woocommerce-admin/docs/components/packages
Albert Juhé Lluveras 5c8cfbc03f Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140)
* Extend docs to report components

* Improve inline documentation in some files

* Update doc files

* Undo unnecessary doc changes

* Remove unnecessary line breaks in sidebar

* Rename 'Client components' to 'Analytics components'

* Minor docs fixes

* Rename toc contents to toc sections

* Update endpoint props doc to add an example and more information

* Fix outdated comment

* Fix merge error
2018-12-22 12:46:10 +01: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 Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
count.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01: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 Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01: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 Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01: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 Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01:00
table.md Report components docs (https://github.com/woocommerce/woocommerce-admin/pull/1140) 2018-12-22 12:46:10 +01: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>
  );
}