Skip to content

A lightweight, easy-to-navigate selection component that displays hierarchical tree data in a searchable, filterable layout.

License

Notifications You must be signed in to change notification settings

kenshoo/react-tree

 
 

Repository files navigation

React Tress

Build Status Test Coverage

Code usage:

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