Skua.Components.Tabs (Skua v0.1.0)

Copy Markdown View Source

A tabs component — an ARIA tablist with client-side panel switching (no server round-trip), full keyboard support (Left/Right/Up/Down/Home/End), and roving tabindex. Token-styled and morphdom-safe.

<.tabs id="settings">
  <:tab label="Profile">
    <p class="sk-p">Profile fields</p>
  </:tab>
  <:tab label="Billing" active>
    <p class="sk-p">Billing</p>
  </:tab>
</.tabs>

Mark one :tab active to choose the initial panel (defaults to the first). Switching happens in the browser via the SkuaTabs hook, which re-asserts the shown panel across LiveView re-renders.

Summary

Functions

tabs(assigns)

Attributes

  • id (:string) (required)
  • label (:string) - accessible name for the tablist. Defaults to "Tabs".
  • class (:any) - Defaults to nil.

Slots

  • tab (required) - Accepts attributes:
    • label (:string) (required)
    • active (:boolean)