# KptTabs (kpt-tabs) + KptTab (kpt-tab) Tabs. Tab content is rendered lazily (only the active one). Import: `import { KptTabs, KptTab } from '@konce-pt/angular';` ## KptTabs - `activeIndex`: model (two-way) - counts only tabs with a panel, link tabs are skipped - `animated`: boolean (default true) - the transition animation (fade+slide, pure CSS) - `animationDuration`: number (default 500) - animation time in ms - `(navigate)`: KptNavigateEvent - a plain click on a link tab, see "Link tabs" ## KptTab - `label`: string (required); `disabled`: boolean - `icon`: string - icon before the label; `iconEnd`: string - icon after it (names from `KptIconRegistry`; either, both or none) - `iconColor`, `iconEndColor`: `KptTabIconColor` (`'primary' | 'success' | 'warning' | 'danger' | 'info'`) or any CSS color, e.g. `var(--brand-accent)` - `href`: string - turns the tab into a link (see "Link tabs"); `target`: string; `rel`: string ## Icons An icon without a color inherits the tab's text color (muted, `primary` on the active tab), so it changes together with the label. A semantic name is set as `data-color` and maps to `--kpt-color-`, so it follows the theme; any other string goes straight into `color`. An own color stays the same on the active tab - it marks a state ("errors", "done"), not the selection. Icons are decorative (`aria-hidden`): the label names the tab. ... ... ... ## Example ... ... ## Link tabs A tab with `href` is a link to another page or an external service, not a tab: it has no panel (its content is ignored), it does not count towards `activeIndex`, and it renders **after** the tabs, outside `role="tablist"` - a tablist may only contain tabs, and a link announced as a tab would promise a panel that does not exist. In the keyboard order the links come after the tab row and before the panel. `target="_blank"` gets `rel="noopener noreferrer"` unless you pass `rel`. A disabled link renders as `` without `href`. A plain click (left button, no modifier keys, no `target`) also emits `(navigate)` with `{ item, url, event }`; an app with a router calls `event.preventDefault()` and navigates itself, without a page reload. ... ## Tokens The active tab: `--kpt-color-primary` (text + bottom edge). Icon colors: `--kpt-color-success`, `--kpt-color-warning`, `--kpt-color-danger`, `--kpt-color-info`. ## Keyboard and ARIA The tab row is a single `Tab` stop (roving `tabindex`): `ArrowLeft`/`ArrowRight` move between tabs, wrapping at the ends, `Home`/`End` jump to the first/last one, and disabled tabs are skipped. Moving activates the tab straight away; the next `Tab` goes to the panel (`tabindex="0"`). Each tab has an `id`, the active one points at the panel with `aria-controls`, and the panel is named by the active tab (`aria-labelledby`). ## Inactive content is destroyed Switching renders the new panel from scratch (that is what the enter animation starts from), so local state inside the previous one - an unsent file upload, expanded sections, scroll position - is lost. Keep such state in your own model, outside the panel.