Skip to content

@vibe-labs/design-components-tabs

Tabs component tokens, styles, and TypeScript types for the Vibe Design System.

Usage

css
@import "@vibe-labs/design-components-tabs";
ts
import { TabsVariants } from "@vibe-labs/design-components-tabs/types";
import type { TabsStyleProps, TabStyleProps } from "@vibe-labs/design-components-tabs/types";

Contents

Tokens (tabs.css)

CSS custom properties defined in @layer vibe.tokens:

Tab List

TokenDefault
--tabs-border-color--border-subtle
--tabs-border-width--border-width-1
--tabs-gap0

Tab Item

TokenDefaultDescription
--tab-height2.5remTab height
--tab-px--space-4Horizontal padding
--tab-font-size--text-smFont size
--tab-font-weight400Default weight
--tab-color--text-secondaryDefault text color
--tab-hover-color--text-primaryHover text color
--tab-hover-bg--surface-hover-overlayHover background
--tab-active-color--text-primaryActive text color
--tab-active-font-weight--font-semiboldActive weight

Indicator

TokenDefault
--tab-indicator-height2px
--tab-indicator-color--color-accent
--tab-indicator-radius--radius-full

Pill Variant

TokenDefault
--tab-pill-radius--radius-full
--tab-pill-bgtransparent
--tab-pill-active-bg--surface-elevated
--tab-pill-active-shadow--shadow-xs

Panel

TokenDefault
--tab-panel-padding--space-4

Generated Styles (tabs.g.css)

Component classes generated into @layer vibe.components.

Tab List

Flex row with bottom border. Active tab indicator sits precisely on the border via negative offset.

Modifiers

  • scrollable — horizontal overflow scroll with hidden scrollbars
  • full — tabs stretch evenly with flex: 1

Tab Item

Interactive inline-flex button with hover/focus/disabled states. aria-selected="true" activates the accent underline indicator via ::after.

Tab Slots

  • tab-icon — leading icon (accent-colored when selected)
  • tab-badge — trailing muted badge

Pill Variant

Completely swaps visual model: no bottom border, contained background with rounded corners, elevated surface + shadow on active tab, indicator hidden.

Tab Panel

Content area with padding. Supports [hidden] attribute for inactive panels.

TypeScript Types (types/)

ts
TabsVariants // ["pill"]
type TabsVariant

interface TabsStyleProps { variant?: TabsVariant; scrollable?: boolean; full?: boolean }
interface TabStyleProps { disabled?: boolean }
interface TabIconStyleProps {}
interface TabBadgeStyleProps {}
interface TabPanelStyleProps {}

Dist Structure

FileDescription
index.cssBarrel — imports tokens + generated styles
tabs.cssToken definitions
tabs.g.cssGenerated component styles
index.js / index.d.tsTypeScript types + runtime constants

Dependencies

Requires tokens from @vibe-labs/design (colors, surfaces, borders, spacing, typography, transitions, elevation).

Build

bash
npm run build