AhaSlides Design
v0.52.0React · Vue · Lit

Components · Navigation

Tabs

Switch between sibling content panels from a tab bar — line, primary or card, in two sizes, with per-tab icons.

Examples

Type
Size
Position
Content
Tabs · line · a leading icon · a disabled tab · click or arrow-key (probe value=0)
Overview panel — a summary of the workspace.
Activity panel — recent events and edits.
Members panel — who has access.
Archived panel — disabled for this plan.
Tabs · line · tab-position=left — a vertical left rail, side active border, up/down arrow-key (probe value=0)
Overview panel — a summary of the workspace.
Activity panel — recent events and edits.
Members panel — who has access.
Archived panel — disabled for this plan.

API

PropTypeDefaultNotes
valuenumber0Zero-based index of the active tab
type'line' | 'primary' | 'card'lineUnderline (line), emphasised Bold underline (primary), or filled bg-accent segment (card)
size'default' | 'small'defaultBar height / label size — small is a tighter, shorter bar
tab-position'top' | 'left'topOrientation — top (horizontal bar, default) or left (vertical rail with the panel to the right; active indicator becomes a side border, arrow-key nav flips to up/down)
itemsJSON arrayLabel-only bar (no panels): [{key?,label,icon?,disabled?}]. Omit to use slotted panels instead
[data-tab]attribute on each panel childThe tab label for that panel; optional data-icon (icon name) + data-disabled
changeCustomEvent<{value}>Composed event; read e.detail.value (index)

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-tabs';   // registers <aha-tabs>

Agent feed for this component (absolute, fetchable anywhere): tabs.agent.json · tabs.md · tabs.llms.txt

When to use

When to use
  • Tabs — several peer content panels the user moves between within one screen
  • Segmented — switching a compact view or mode, not larger panels
  • Select — the choices are many or space is tight
Keep labels to one or two words, sentence case. Order tabs by expected use, most common first, and don't hide critical content behind a rarely-picked tab. Use line/primary for in-page view switching; reach for card when the bar sits on a tinted surface and needs a filled active chip.
Surfaces
editor dashboard settings

Spec

Bar gap 24, 1px border bottom (border #E3E3E3) — card drops the rule, gap 8 · Tab SemiBold 600 14 / line-height 21, pad 8 0, 8px gap to a 16px leading icon · Line (default) active color-primary #6A1EBB text + 2px color-primary underline · Primary same underline, active label Bold 700 · Card active in a bg-accent #F9F5FF pill, radius-sm 6, no underline; hover bg-hover · Inactive text-secondary #4A4A4A → text-default on hover · Disabled text-disabled #B5B5B5, not-allowed, skipped by arrow-key nav · Small 13px label, tighter padding + gap · Left rail tab-position=left — vertical rail, right-edge 1px rule; active moves to a 2px color-primary side border (line/primary), card keeps its pill; up/down arrow-key nav