ValyroUI English version

Tabs

Вкладки. Бесплатно, MIT · Навигация и каркас › Переключение

Установка

npx valyro-cli@latest add tabs
npx shadcn@latest add https://valyro.xyz/r/tabs.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Tabs } from 'valyro-ui';

Пропсы

PropTypeDefault
itemsTabItem[]Tabs in order, each with optional panel content. Or compose them as children: Tabs.List, Tabs.Tab, Tabs.Panel.
childrenReactNodeThe compound form instead of items: a Tabs.List of Tabs.Tabs, then a Tabs.Panel per tab that has content.
valuestringControlled value; use with onValueChange.
defaultValuestringInitial value when uncontrolled.
onValueChange(value: string) => voidCalled with the new value when it changes.
variant'underline' | 'pills''underline'underline: a bar slides along the baseline; pills: a filled shape slides behind the active tab.
labelstringAccessible name of the tab list.
animation'default' | 'spring''default'spring: the indicator springs between tabs, the new panel slides in from the side of the tab it came from and the panel area eases to the new height. default: the theme's indicator, instant panels.
keyboardActivation'automatic' | 'manual''automatic'automatic (default): moving focus with the arrow keys selects the tab. manual: the arrows only move focus and Enter or Space selects, for panels that are slow to render or load (WAI-ARIA APG, React Aria).
orientation'horizontal' | 'vertical''horizontal'vertical: the tabs stack in a column beside the panel and move with ArrowUp / ArrowDown.

Составные части

Tabs.List (TabsList), Tabs.Tab (TabsTab), Tabs.Panel (TabsPanel)

Похожие компоненты

  • Segmented Control — Переключатель режимов
  • Pagination — Постраничная навигация
  • Stepper — Пошаговые процессы
  • App Shell — Каркас приложения
  • Navbar — Верхняя навигация
  • Sidebar — Боковая панель
  • Resizable Panels — Панели с изменяемым размером
  • Breadcrumbs — Хлебные крошки
  • Dropdown Menu — Выпадающее меню
  • Context Menu — Контекстное меню
  • Command Palette — Меню команд в стиле ⌘K
  • Keyboard Map Overlay — Карта горячих клавиш экрана: поиск, клавиатура и режим тренировки

Назад: Breadcrumbs · Далее: Segmented Control · Весь раздел «Навигация и каркас»