Accordion
Раскрывающиеся секции. Бесплатно, MIT · Данные и показатели › Списки и деревья
Установка
npx valyro-cli@latest add accordion
npx shadcn@latest add https://valyro.xyz/r/accordion.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { Accordion } from 'valyro-ui';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
items | readonly AccordionItem[] | Sections in order: title is the trigger, content the panel, value the id used by value. Or compose them as children: Accordion.Item with an Accordion.Trigger and an Accordion.Content. | |
children | ReactNode | The compound form instead of items: Accordion.Item elements. | |
type | 'single' | 'multiple' | 'single' | single keeps at most one section open. |
collapsible | boolean | true | In single mode, whether the open section can be closed again. |
value | string[] | Values of the open sections. | |
defaultValue | string[] | [] | Initial value when uncontrolled. |
headingLevel | 2 | 3 | 4 | 5 | 6 | 3 | Level of the heading around each trigger, to fit the page's heading outline. Default 3. |
onValueChange | (value: string[]) => void | Called with the new value when it changes. | |
animation | 'default' | 'spring' | 'default' | spring: sections open on a critically damped spring, the content drops in as it is revealed and the chevron turns with a bounce. default: the theme's curve. |
Составные части
Accordion.Item (AccordionItemPart), Accordion.Trigger (AccordionTrigger), Accordion.Content (AccordionContent)
Похожие компоненты
- List Block — Блок списка с картинками или иконками, описанием и значением
- Description List — Список «ключ — значение»: столбиком, строками или сеткой с иконками
- Tree View — Древовидные структуры
- Sortable — Сортировка перетаскиванием
- JSON Viewer — Просмотр JSON
- Timeline — Хронология событий
- Data Table — Таблицы с поиском и сортировкой
- Data Grid — Таблица на 100 000 строк: группировка, фильтры, редактирование
- Virtual List — Виртуальный список на 100 000 строк
- Bulk Action Bar — Панель действий над выбранными строками с горячими клавишами
- Card — Универсальные карточки
- Item Card — Карточка-строка: иконка, заголовок, описание и элемент управления справа
Назад: Tree View · Далее: Sortable · Весь раздел «Данные и показатели»