Raxol.UI.Components.Input.Tabs (Raxol v2.3.0)

View Source

A tab bar component with keyboard navigation.

Renders a horizontal row of tab labels with dividers. The active tab is highlighted with reverse video. Supports arrow keys, Home/End, and number keys (1-9) for direct tab selection.

This component only renders the tab bar itself -- content switching is the parent's responsibility via the on_change callback.

Summary

Types

t()

@type t() :: %{
  id: String.t() | atom(),
  tabs: [tab()],
  active_index: non_neg_integer(),
  focused: boolean(),
  on_change: (non_neg_integer() -> any()) | nil,
  style: map(),
  theme: map()
}

tab()

@type tab() :: %{id: atom() | String.t(), label: String.t()}