react.js-nested-tree
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "react.js-nested-tree", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"main": "dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "description": "The react.js-nested-tree package is a versatile React component designed for creating nested, hierarchical tree structures. This package is especially useful for applications that require a visual representation of nested data, such as file explorers, category trees, or organizational charts.", |
@@ -25,7 +25,24 @@ # react.js-nested-tree | ||
## Usage | ||
## Usage: | ||
### Props | ||
The `TreeProps` interface defines the properties for the `Tree` component. Below is a detailed description of each property. | ||
| Property | Type | Description | | ||
| ------------------ | ------------------------------- | ------------------------------------------------------------------------ | | ||
| `treeData` | `Item[]` | An array of `Item` objects representing the data for the tree structure. | | ||
| `treeClassName` | `string` | (Optional) A class name to apply to the tree container element. | | ||
| `itemClassName` | `string` | (Optional) A class name to apply to each tree item. | | ||
| `subTreeClassName` | `string` | (Optional) A class name to apply to each sub-tree container. | | ||
| `ItemComponent` | `React.ComponentType<TreeItem>` | A React component to render each tree item. | | ||
| `subTreeStyle` | `React.CSSProperties` | (Optional) Inline styles to apply to each sub-tree container. | | ||
| `parentTreeStyle` | `React.CSSProperties` | (Optional) Inline styles to apply to the parent tree container. | | ||
| `treeItemStyle` | `React.CSSProperties` | (Optional) Inline styles to apply to each tree item. | | ||
### Example | ||
- ./App.tsx | ||
```tsx | ||
```typescript | ||
import "./App.css"; | ||
@@ -79,1 +96,2 @@ import { TreeItems } from "./TreeItems"; | ||
> [react-js-nested-tree-demo](https://codesandbox.io/p/devbox/react-js-nested-tree-demo-mrggtt) | ||
12988
96