Tree View
Древовидные структуры. Бесплатно, MIT · Данные и показатели › Списки и деревья
Установка
npx valyro-cli@latest add tree-view
npx shadcn@latest add https://valyro.xyz/r/tree-view.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { TreeView } from 'valyro-ui';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
nodes | readonly TreeViewNode[] | Root nodes; nodes with children render as expandable branches. Or compose them as children: TreeView.Item elements, nested for branches. | |
children | ReactNode | The compound form instead of nodes: TreeView.Item elements. | |
expanded | string[] | Ids of expanded nodes. | |
defaultExpanded | string[] | [] | Initial expanded when uncontrolled. |
onExpandedChange | (expanded: string[]) => void | Called with the new expanded when it changes. | |
selected | string | null | Id of the selected node. | |
defaultSelected | string | null | null | Initial selected when uncontrolled. |
onSelectedChange | (id: string | null) => void | Called with the new selected when it changes. | |
animation | 'default' | 'spring' | 'default' | A branch unfolds, pushing the rows below down, and folds away again when closed (it stays mounted until it has). spring: it opens on a spring. default: on the theme's curve and duration. |
Составные части
TreeView.Item (TreeViewItem)
Похожие компоненты
- List Block — Блок списка с картинками или иконками, описанием и значением
- Description List — Список «ключ — значение»: столбиком, строками или сеткой с иконками
- Accordion — Раскрывающиеся секции
- Sortable — Сортировка перетаскиванием
- JSON Viewer — Просмотр JSON
- Timeline — Хронология событий
- Data Table — Таблицы с поиском и сортировкой
- Data Grid — Таблица на 100 000 строк: группировка, фильтры, редактирование
- Virtual List — Виртуальный список на 100 000 строк
- Bulk Action Bar — Панель действий над выбранными строками с горячими клавишами
- Card — Универсальные карточки
- Item Card — Карточка-строка: иконка, заголовок, описание и элемент управления справа
Назад: Description List · Далее: Accordion · Весь раздел «Данные и показатели»