From e18c9ec01ab810f508d225f7c61d3b97def04b82 Mon Sep 17 00:00:00 2001 From: Lior Heber Date: Mon, 24 Feb 2020 13:16:40 -0500 Subject: [PATCH] add basic readme (#23) --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f7dfd82 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# React Tress + +[![Build Status](https://travis-ci.org/kenshoo/react-tree.svg?branch=master)](https://travis-ci.org/kenshoo/react-tree) +[![Test Coverage](https://api.codeclimate.com/v1/badges/7b44acc9042c5ee410a8/test_coverage)](https://codeclimate.com/github/kenshoo/react-tree/test_coverage) + +Code usage: + + + + +```jsx +import ReactTree from "@kenshooui/react-tree"; + +const structure = [ + ["Profiles", "Performance", "Clicks"], + ["Profiles", "Performance", "Imp"], + ["Profiles", "Attribute", "Agency"], + ["Profiles", "Attribute", "Progress"], + ["Profiles", "Attribute", "Create Date"], + ["Campaigns", "Performance", "Clicks"], + ["Campaigns", "Performance", "Cost"], + ["Campaigns", "Performance", "CTR"], + ["Campaigns", "Attribute", "campaign name"], + ["Ad Groups", "Attribute", "Ad Group Name"] +]; + + {}} +/>; +``` + +## Props + +| Name | Type | Default | Description | +| :------------------ | :-------- | :--------------------- | :-------------------------------------------------------------- | +| `structure` | `Array` | `[]` | `Component input - array of leaves along with their ancestors` | +| `title` | `String` | `` | `Title to be displayed on root mode` | +| `onSelect` | `Func` | `` | `callback when clicking a leaf` | +| `NoResultsRenderer` | `` | `no_matching_items.js` | `renderer when having no results on searching` |