Skip to content

Commit

Permalink
add basic readme (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
liorheber authored Feb 24, 2020
1 parent e6a6b59 commit e18c9ec
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:


<!-- example -->

```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"]
];

<ReactTree
structure={structure}
title={"Add filter criteria"}
onSelect={() => {}}
/>;
```

## 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` |

0 comments on commit e18c9ec

Please sign in to comment.