- View the changelog: Releases
- Features
- Installation
- Usage
- TreeList Props
- TreeList Store
- TreeList Tree
- Contributing
- Component for rendering a tree in a tree like interface
- Drag and drop support
- Context menu support
- Themeable
Supported in modern browsers.
# latest stable
yarn add @stoplight/tree-list @stoplight/ui-kit
This is a bare minimum required to have anything rendered.
import { TreeList, TreeStore, Tree } from '@stoplight/tree-list';
import '~@stoplight/tree-list/styles/_tree-list.scss';
const root = Tree.createArtificialRoot();
root.children.push(
{
id: generateRandomId(),
name: 'foo',
parent: root,
children: [],
},
{
id: generateRandomId(),
name: 'bar',
parent: root,
},
{
id: generateRandomId(),
name: 'baz',
parent: root,
children: [],
},
);
const store = new TreeStore(new Tree({}, root), new TreeState());
<TreeList store={store} />;
You will also need to make sure the stylesheet is loaded.
@import '~@stoplight/tree-list/styles/tree-list';
- Clone repo.
- Create / checkout
feature/{name}
,chore/{name}
, orfix/{name}
branch. - Install deps:
yarn
. - Make your changes.
- Run tests:
yarn test.prod
. - Stage relevant files to git.
- Commit:
yarn commit
. NOTE: Commits that don't follow the conventional format will be rejected.yarn commit
creates this format for you, or you can put it together manually and then do a regulargit commit
. - Push:
git push
. - Open PR targeting the
master
branch.