Skip to contentKino
Skip to Content

Tabs

Tabs whose highlight travels to the picked tab, as a pill or as an underline.

npx shadcn add https://kinoui.com/r/tabs.json
Share on

Examples

12 open issues, 3 of them due this week.

Default

A pill travels to the picked tab, and each label changes colour as the pill crosses it. A backdrop follows the pointer.

12 open issues, 3 of them due this week.

Underline

With variant set to line, an underline travels in place of the pill.

Workspace name, logo and time zone.

Vertical

The list stands beside its content, and the up and down arrows move along it.

9,112visitors in the last 7 days

Sharing the width

Give the list w-full and each trigger flex-1.

42 issues, sorted by priority.

Icons

An icon sits before or after the label.

42 issues, sorted by priority.

Icon only

A tab with only an icon needs an aria-label and a square shape.

$24 per seat, billed every month.

Disabled

A disabled tab fades, and the arrow keys still reach it.

January: 12 invoices sent.

More tabs than fit

A list wider than its column scrolls. An edge fades while tabs are hidden past it.

Installation

npx shadcn@latest add https://kinoui.com/r/tabs.json
Files
lib/reduce-motion.tslib/resize.tslib/run-progress.tslib/highlight.tslib/pill.tslib/scroll.tscomponents/kino/tabs.tsx
Packages
@base-ui/reactclass-variance-authority

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Tabs

PropTypeDefaultDescription
defaultValueanyNoneThe tab picked at first, when you leave the state to the tabs.
valueanyNoneThe picked tab, when you hold the state.
onValueChange(value) => voidNoneCalled when another tab is picked.
orientation'horizontal''vertical''horizontal'Whether the list lies above its content or stands beside it.

TabsList

PropTypeDefaultDescription
variant'default''line''default'A pill behind the picked tab, or an underline.
activateOnFocusbooleanfalsePicks a tab as focus reaches it with the arrow keys.
classNamestringNoneGoes on the outer box, the one you lay out.

TabsTrigger

PropTypeDefaultDescription
valueanyNoneWhich content it shows.
disabledbooleanfalseFades the tab and blocks presses.

TabsContent

PropTypeDefaultDescription
valueanyNoneThe tab it belongs to.
keepMountedbooleanfalseKeeps the content in the page while another tab is picked.

Data attributes

AttributeOnDescription
data-activeTabsTriggerPresent on the picked tab.
data-disabledTabsTriggerPresent on a disabled tab.
data-orientationTabshorizontal or vertical.
data-variantTabsListdefault or line.

CSS variables

VariableSet it onDefaultDescription
--tabs-content-riseTabs, or anything above it6pxHow far new content rises as it fades in.

Accessibility

  • Arrow keys move focus along the tabs, and Enter or Space picks the focused one.
  • Name the list with aria-label on TabsList.
  • In the default variant the pill holds a second copy of the list, so a label can be two colours at once. The copy is inert and hidden from screen readers. Keep an id, or anything with an effect, out of the children of TabsList, or it exists twice.
  • When the system asks for less motion, the highlight, the backdrop and the scroll jump to their place, and content appears without rising.