ValyroUI English version

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';

Пропсы

PropTypeDefault
nodesreadonly TreeViewNode[]Root nodes; nodes with children render as expandable branches. Or compose them as children: TreeView.Item elements, nested for branches.
childrenReactNodeThe compound form instead of nodes: TreeView.Item elements.
expandedstring[]Ids of expanded nodes.
defaultExpandedstring[][]Initial expanded when uncontrolled.
onExpandedChange(expanded: string[]) => voidCalled with the new expanded when it changes.
selectedstring | nullId of the selected node.
defaultSelectedstring | nullnullInitial selected when uncontrolled.
onSelectedChange(id: string | null) => voidCalled 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 · Весь раздел «Данные и показатели»