Raxol.UI.Components.Input.Tabs (Raxol v2.6.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()}

Functions

broadcast(msg)

command(cmd)

mount(state)

Callback implementation for Raxol.UI.Components.Base.Component.mount/1.

schedule(msg, delay)

unmount(state)

Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.

update(props, state)

Callback implementation for Raxol.UI.Components.Base.Component.update/2.