Skip to main content

HuxTabs

The HuxTabs component provides a clean and modern way to organize content into multiple panels with tab navigation. It supports multiple variants, sizes, and includes built-in theme awareness.

Basic Usage

Variants

Default

The default variant displays tabs with an underline indicator.

Pill

The pill variant displays tabs with a background indicator that highlights the active tab.

Minimal

The minimal variant displays tabs without any indicator, relying on text color changes.

Sizes

Small

Medium (Default)

Large

With Icons

Add icons to your tabs for better visual hierarchy.

With Badges

Add badges to indicate notifications or counts.

Scrollable Tabs

Enable horizontal scrolling for tabs that don’t fit in the available space.

Tab Alignment

Control how tabs are aligned within the available space.

Disabled Tabs

Mark individual tabs as disabled to prevent interaction.

Expanding Content

By default, tab content takes only the space it needs. Use expandContent to fill available vertical space.
Set expandContent: true when tabs are in a bounded container (like an Expanded widget) and you want the content to fill available space. Leave it false (default) for better compatibility with unbounded layouts.

Controlled Tabs

Control the active tab programmatically.

API Reference

HuxTabs

HuxTabItem

HuxTabVariant

  • HuxTabVariant.default_ - Default tabs with underline indicator
  • HuxTabVariant.pill - Pill-style tabs with background indicator
  • HuxTabVariant.minimal - Minimal tabs with no indicator

HuxTabSize

  • HuxTabSize.small - Small tabs for compact layouts
  • HuxTabSize.medium - Medium tabs for standard layouts (default)
  • HuxTabSize.large - Large tabs for prominent navigation

Theming

HuxTabs automatically adapts to light and dark themes using HuxTokens. The component uses the following design tokens:
  • HuxTokens.tabActiveBackground - Background color for active tab
  • HuxTokens.tabActiveText - Text color for active tab
  • HuxTokens.tabInactiveBackground - Background color for inactive tab
  • HuxTokens.tabInactiveText - Text color for inactive tab
  • HuxTokens.tabHoverBackground - Hover background color for tabs
  • HuxTokens.tabBorder - Border color for tab container
  • HuxTokens.tabIndicator - Indicator color for active tab
The tabs component follows Hux UI design principles with consistent spacing, typography, and color usage. All variants automatically adapt to your theme configuration.