Skip to content

Tabs

Three sections, one screen. Arrow keys move and select; panels toggle with them.

Example

Usage numbers and recent activity live here.

Invoices, receipts, and the current plan.

Members, roles, and invitations.

<Tabs tabs={items}>
  <div data-tab-panel="overview" role="tabpanel"
    id="ink-panel-overview" aria-labelledby="ink-tab-overview">
    Usage numbers and recent activity live here.
  </div>
  ...
</Tabs>

Panel contract

Each panel is your markup with data-tab-panel matching the tabid, plus role="tabpanel", a matchingid="ink-panel-[id]", and aria-labelledby="ink-tab-[id]".

Pill and boxed

Pill treatment for toolbars.

Invoices live here.

Members live here.

Boxed treatment for cards.

Invoices live here.

Members live here.

<Tabs tabs={items} variant="pill">...</Tabs>
<Tabs tabs={items} variant="boxed">...</Tabs>

Props

PropTypeDefaultDescription
tabsArray<{ id, label }>-Tabs in order.
activestringfirst tabInitial tab id.
tablistLabelstringTabsLandmark name.
variantunderline | pill | boxedunderlineTab list treatment.

Events

document.addEventListener("ink:tab:change", (event) => {
  console.log(event.detail.id);
});

Accessibility