Tabs
Tabs switch panels. The default is an underline (line). segment is the compact alternative. Card tabs are not part of v1.
Demos
Line
Active text uses brand-pressed. A 2px brand indicator sits on the divider. Arrow keys move between enabled tabs.
Segment
The track is the quiet button fill. The active segment is a 22% brand wash with pressed text. There is no underline and no card chrome.
Sizes
Line hit areas match Button:
sm 28, md 34, lg 40. Segment tabs sit inside the track at 26 / 30 / 36. Disabled tab
Disabled panes stay in the list at 50% opacity and are skipped by click and keyboard.
Many tabs
The tab list scrolls horizontally and does not wrap. On a narrow viewport, swipe the tab list.
Animation off
animated defaults to true (180ms panel fade and indicator slide). :animated="false" or animated="false" turns it off. Icon label
Put rich label content in the pane’s
tab slot. It replaces the tab string. API
Tabs Props
| Prop | Type | Default |
|---|---|---|
value | string | first enabled pane |
default-value | string | — |
type | 'line' | 'segment' | 'line' |
size | 'sm' | 'md' | 'lg' | 'md' |
animated | boolean | true |
placement | 'top' | 'top' |
value is controlled when you set it. With an empty value, default-value or the first enabled pane is selected. v1 placement is top only; a vertical tab list is deferred. There is no card type.
animated="false" is respected (the string "false" is not treated as true).
Tab Pane Props
| Prop | Type | Default |
|---|---|---|
name | string | — |
tab | string | — |
label | string | — |
disabled | boolean | false |
label aliases tab. The tab string wins when both are set. name is the value key and should be unique.
Tabs Slots
| Name | Description |
|---|---|
| default | gk-tab-pane children |
pane tab | Rich tab label. Replaces the tab text |
| pane default | Panel body |
Tabs Events
| Name | Description |
|---|---|
update:value | Selection changed. detail: { value: string }. Bubbles; composed: true. |
change | Same payload as update:value. |
CSS Parts
| Part | Description |
|---|---|
tablist | Scrollable tab row |
tab | One tab button |
indicator | 2px brand underline. Hidden for segment |
panels | Panel stack |
panel | The visible or hidden panel shell |
Accessibility
- The list is
role="tablist"witharia-orientation="horizontal". Passaria-labelongk-tabsto name it. - Each tab is
role="tab"witharia-selected,aria-controls, andaria-disabledwhen needed. - Each panel is
role="tabpanel"witharia-labelledby. Inactive panels arehidden. - Left / Right move among enabled tabs and wrap. Home and End jump to the ends. Tab leaves the tab list and enters the active panel.
- Only the selected enabled tab is in the tab order.
- Focus-visible uses the soft brand ring.
Vertical placement and card tabs are intentionally out of this version.