Layout & Navigation WAI-ARIA Tablist Keyboard Nav Lightweight Tailwind v4

Tabs

Accessible, keyboard-navigable tab system with animated indicator slider and light-DOM panels.

Interactive Preview

Live Edit & Viewport Resizer
Variants:

Installation

Add the Tabs component to your project via CLI:

terminal bash
npx plain-ui add tabs

Features

  • Compliant WAI-ARIA role='tablist', role='tab', and role='tabpanel'
  • Keyboard navigation support with Left and Right arrow keys
  • Segmented pill and underline tab styles
  • Smooth active indicator sliding animation

Variants & Examples

Underline Tabs

Classic tab navigation with bottom underline indicator.

tabs-underline-tabs.html html
<div class="w-full max-w-md mx-auto p-4" data-tabs>
  <div role="tablist" class="flex border-b border-zinc-200 dark:border-zinc-800 text-sm font-medium">
    <button class="px-4 py-2 border-b-2 border-blue-600 text-blue-600 dark:text-blue-400 font-semibold cursor-pointer">Account</button>
    <button class="px-4 py-2 border-b-2 border-transparent text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 cursor-pointer">Password</button>
    <button class="px-4 py-2 border-b-2 border-transparent text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 cursor-pointer">Billing</button>
  </div>
</div>

Attributes & Classes

Attribute / Prop Type Default Description
role='tablist' WAI-ARIA - Identifies container as a tablist for screen readers.
aria-selected boolean - Indicates the active tab state.

Accessibility & Keyboard Navigation

  • Supports Left/Right arrow keyboard cycling across tabs.
  • Proper aria-controls and aria-labelledby linkages between tabs and panels.
Components
#
Button
Interactive button primitives with rich visual variants, loading spinners, icons, and keyboard accessibility.
Core Primitives
#
Dialog
Native HTML <dialog> modal with backdrop blur, @starting-style entry animations, and accessible focus trapping.
Overlays & Modals
#
Popover
Native HTML Popover API (popover='auto') with zero JavaScript, CSS anchor positioning, and automatic light dismiss.
Overlays & Modals
#
Floating Label Input
Modern animated floating label form controls utilizing HTML5 placeholder-shown pseudo-class and Tailwind peer selectors.
Forms & Inputs
#
Border Beam
Dynamic glowing animated border beam gradient traveling continuously around cards and containers using pure CSS animations.
Motion & Effects
#
Shimmer Button
High-performance glowing shimmer button with animated radial light sweep across the surface.
Motion & Effects
#
Dock
macOS-inspired interactive dock with smooth pointer proximity magnification physics, hover tooltips, and app status dots.
Layout & Navigation
#
Bento Grid
Modern modular 12-column asymmetric bento box layout with spotlight card glow, metric widgets, and responsive auto-fitting.
Layout & Surfaces
#
Accordion
Pure HTML <details> and <summary> accordion with smooth height expansion animation and animated rotating chevrons.
Core Primitives
#
Tabs
Accessible, keyboard-navigable tab system with animated indicator slider and light-DOM panels.
Layout & Navigation
Getting Started
📖
Getting Started & Tailwind v4 Setup
Quick start guide and architecture overview
Navigate Select
Plain UI Search