Skip to content

Commit

Permalink
docs(TreeView): update mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Aug 22, 2024
1 parent 2b795cf commit e6f98ee
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/react/src/components/TreeView/TreeView.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ArgsTable } from '@storybook/blocks';
import { ArgsTable, Canvas, Story } from '@storybook/blocks';
import * as TreeViewStories from './Treeview.stories';

# TreeView

Expand All @@ -12,6 +13,28 @@ import { ArgsTable } from '@storybook/blocks';

## Overview

TreeView is a component that allows users to navigate through a hierarchy of items. It is used to display nested lists of items that can be expanded or collapsed to show and hide additional items.

<Canvas>
<Story of={TreeViewStories.Default} />
</Canvas>

## With Controlled Expansion

The `expanded` prop can be used to control the expansion state of the TreeView. The `isExpanded` prop can be used to determine if an individual tree node is expanded or collapsed.

<Canvas>
<Story of={TreeViewStories.WithControlledExpansion} />
</Canvas>

## With Custom Icons

The `renderIcon` prop can be used to customize the icons of each node in the TreeView.

<Canvas>
<Story of={TreeViewStories.WithCustomIcons} />
</Canvas>

## Component API

<ArgsTable />
Expand Down

0 comments on commit e6f98ee

Please sign in to comment.