ValyroUI Русская версия

Tabs

Tabs. Free, MIT · Navigation and layout › Switching

Installation

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

Props

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.

Compound parts

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

Related components

Previous: Breadcrumbs · Next: Segmented Control · All Navigation and layout