GitHubnpm

Accent theme

Base radius

GitHubnpm

Accent theme

Base radius

Colour scheme

Docs menu

Guides


Primitives
Forms
Layout
Feedback
Overlays
Navigation
Data Display
AI

Tabs

There's no native tabs element yet, this is the WAI-ARIAtablist pattern: real <button> tabs with roving tabIndex and arrow-key navigation, and real panels hidden with the native hidden attribute, not just visually, but genuinely removed from layout and the accessibility tree.

A summary of the project.
Usage
import { Tabs, TabsList, Tab, TabPanel } from "@kernelui-lib/react";

<Tabs defaultValue="profile">
  <TabsList aria-label="Account settings">
    <Tab value="profile">Profile</Tab>
    <Tab value="billing">Billing</Tab>
    <Tab value="security">Security</Tab>
  </TabsList>
  <TabPanel value="profile">Update your name, email, and avatar.</TabPanel>
  <TabPanel value="billing">Manage your plan and payment methods.</TabPanel>
  <TabPanel value="security">Change your password and enable 2FA.</TabPanel>
</Tabs>

Playground

Toggle every adjustable prop and watch the component — and the code — update live.

A summary of the project.
Unstyled

Same component — Kernel look stripped. See Platforms.

default tab
disable 'activity' tab
Usage
<Tabs defaultValue="overview">
  <TabsList aria-label="Project sections">
    <Tab value="overview">Overview</Tab>
    <Tab value="activity">Activity</Tab>
    <Tab value="settings">Settings</Tab>
  </TabsList>
  <TabPanel value="overview">A summary of the project.</TabPanel>
  <TabPanel value="activity">Recent commits and comments.</TabPanel>
  <TabPanel value="settings">Project-level configuration.</TabPanel>
</Tabs>

Props

Props for Tabs.
ComponentPropType
TabsdefaultValuestring (required)
Tabsvalue / onValueChangestring / (value) => void
Tabvaluestring (required)
TabPanelvaluestring (required)

Accessibility

  • Left/Right, Home, and End move focus and activate the corresponding tab (automatic activation).
  • Each panel is tabIndex=0, so keyboard users can move directly from the tab into the panel's content.