Skip to content

Commit

Permalink
Added snippet to EuiTreeView (#3230)
Browse files Browse the repository at this point in the history
  • Loading branch information
anishagg17 authored Apr 2, 2020
1 parent c82f374 commit afe4fea
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src-docs/src/views/tree_view/tree_view_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,36 @@ const treeViewHtml = renderToHtml(TreeView);
const treeViewCompressedSource = require('!!raw-loader!./compressed');
const treeViewCompressedHtml = renderToHtml(TreeViewCompressed);

const treeViewSnippet = [
`<EuiTreeView
items={[
{
label: 'Item One',
id: 'item_one',
icon: <EuiIcon type="arrowRight" />,
iconWhenExpanded: <EuiIcon type="arrowDown" />,
isExpanded: true,
children: [
{
label: 'Item A',
id: 'item_a',
icon: <EuiIcon type="document" />,
},
{
label: 'Item B',
id: 'item_b',
icon: <EuiIcon type="document" />,
},
],
},
{
label: 'Item Two',
id: 'item_two',
}
]}
/>`,
];

export const TreeViewExample = {
title: 'Tree view',
sections: [
Expand Down Expand Up @@ -51,6 +81,7 @@ export const TreeViewExample = {
),
components: { EuiTreeView },
demo: <TreeView />,
snippet: treeViewSnippet,
props: { EuiTreeView, EuiTreeViewNode },
},
{
Expand Down

0 comments on commit afe4fea

Please sign in to comment.