Krizaka UI
Krizaka UI

Tabs

Views of the same page, one at a time: underlined sections, a segmented switch, pills or binder dividers that organise collections — one light glides from the active tab to the next.

Web · ✓Mobile · ✓Desktop · ✓BetaNavigation
Support level
Beta
Size
4.7 kB gzip, budget 12.3 kB
Who uses it
25 files of the live products and sites import it (Verikora: 6, Folioviv: 2, Sovkora: 8) Counted in the dated inventory of 2026-11-23.
import { Tabs } from "@krizaka/ui/tabs";

Web and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.

Why it is here. Used by Sovkora, Verikora, Folioviv.

When to use

  • To split a page into sections the user switches between without leaving it: videos, stories, about.
  • variant="segmented" for a view switch (grid, list); pills for a feed's sections.
  • variant="binder" to organise a workspace's collections, tags or statuses as binder dividers (intercalaires): a coloured edge (hue), the words and a count; best as routes (Tabs.Nav), so the address is the state.

When not to use

  • For a filter that narrows a list.Use instead: Chip
  • To go to other pages from a tablist: use Tabs.Nav (links), not Tabs.Trigger.
  • For a choice in a form.Use instead: Radio group

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { Tabs } from "@krizaka/ui/tabs";

Examples

Underline

The sections of a page; a disabled tab is skipped.

Segmented

A view switch: equal segments in a track.

Pills

A feed's sections, scrolling sideways on a phone.

Vertical

orientation="vertical": the list on the side.

Binder dividers

variant="binder" as routes: a client's collections as dividers with their colour and count, « + Divider » after them; they scroll sideways with fading edges when they do not fit.

Tabs as routes

Tabs.Nav + Tabs.NavLink: each tab is a link, the active one comes from the current route (aria-current="page"), the URL is the state.

Props

TabsRoot

value/defaultValue + onValueChange, orientation (horizontal by default), variant for the list.

PropTypeDefaultDescription
routeKeystring—Binds the active tab to this search parameter of the URL (?tab=…): the URL is the state. Without it the state is local — only for an ephemeral choice.
routeValuesreadonly string[]—The values the parameter may hold (the tabs' values); the first is the default unless defaultValue says otherwise.
variant"segmented" | "underline" | "pills" | "binder"underlineunderline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers that organise collections, tags, statuses).

TabsList

The tabs. Name it (aria-label) when no heading says what it switches. One light glides to the active tab.

PropTypeDefaultDescription
addTabsAdd—A « + » button after the tabs (variant="binder": « + Intercalaire »): its words and what it does.

TabsTrigger

PropTypeDefaultDescription
countnumber—A count after the words (clients in a collection, unread): part of the tab's name.
hueTabsHue—variant="binder": the divider's colour (the accent by default).

TabsNav

Tabs as routes: a nav of links, the URL is the state. Per WAI-ARIA these are links, not a tablist: each tab is an anchor, the active one carries aria-current="page", the keyboard is the page's own (Tab walks the links, Enter follows one) and there is no panel — the page is the panel. The same looks and the same gliding light as Tabs.List.

PropTypeDefaultDescription
childrenrequiredReactNode—The tabs: Tabs.NavLink.
currentrequiredstring—The current route, passed in: the path with its search (usePathname() + useSearchParams(), /docs?tab=api). The active tab comes from it; no local state.
labelrequiredstring—The navigation's accessible name (« Sections »).
addTabsAdd—A « + » button after the tabs (variant="binder": « + Intercalaire »).
variant"segmented" | "underline" | "pills" | "binder"underlineunderline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers).

TabsNavLink

One tab of Tabs.Nav: an anchor that is active when the current route is its href.

PropTypeDefaultDescription
asChildboolean—Renders your router's <Link> (pass it as the only child; the href goes on this part and on the link).
countnumber—A count after the words (not with asChild: put it in your link).
exactboolean—Match this path only, not the pages below it.
hueTabsHue—variant="binder": the divider's colour (the accent by default).

Accessibility

  • Radix Tabs: tablist, tab with aria-selected and aria-controls, tabpanel; name the list with aria-label.
  • A disabled tab is skipped.
  • A count is part of the tab's name (« Regulars 21 »); a binder divider's colour is decoration (the words say it).
  • The binder's « + » is a button after the list (a tablist holds only tabs), reached by Tab after the tabs.

Keyboard

KeysAction
TabMoves to the active tab, then into its panel.
Arrow keys / Home / EndMove between tabs and activate them.

Best practices

  • Short labels of one or two words; the active one should be clear without colour.
  • Binder: the colour organises, it never says on its own — the words and the count do. hue takes a role of the theme (accent · success · warning · danger · neutral), each 3:1 or more on both themes; give a status divider its status' role. No paper texture: it is the products' register.
  • Binder: « + » (add) sits after the dividers, outside the tab list, for creating a collection.
  • Keep the URL in sync with the active tab when a tab is worth sharing: better, use Tabs.Nav (tabs as routes), where the route is the state and the active tab is read from it.

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page