Controls

Tabs

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Tabs

Overview

Three deploys today, all green.

Tabs

A row of tabs whose pill stretches across to the one you pick.

Installation

npx shadcn@latest add ikislay/pixel-ui/tabs

How to use

import { Tabs } from "@/components/ui/tabs"
export function Demo() {
return (
<Tabs
aria-label="Account"
items={[
{ value: "profile", label: "Profile", content: <p>Your public details.</p> },
{ value: "billing", label: "Billing", content: <p>Plans and invoices.</p> },
]}
/>
)
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
items*
{ value: string; label: ReactNode; content: ReactNode }[]

The tabs and the panel each one shows.

value
string

Controls the open tab. Leave it unset to let the tabs manage themselves.

defaultValue
string

The starting tab when uncontrolled. Defaults to the first one.

onValueChange
(value: string) => void

Called with the newly opened tab.

onFeedback
(event: "select") => void

Called at each semantic moment, for wiring sound or haptics.

className
string

Merged onto the root element.