Displays tabs:
+ +This component is the most straightforward way to implement tabs. Its usage is recommended whenever possible.
+Tab panels' content is passed via slots named by corresponding tabs' IDs from objects of the tabs
array.
Each tabbed interface needs to have ariaLabel
or ariaLabelledBy
and also an identifier, tabsID
, that is unique in regard to a page where tabs are rendered.
When implementing tabs with the router, it's the router view rather than KTabs
that is responsible for displaying the active tab content.
In such a case, define to
property with a router link object as its value in objects of the tabs
array:
Then, tabs will be rendered as router links and you can use the router view to display the active tab content:
+ +Note that here, tabs content is not passed to KTabs
via named slots, for it's the router view that's responsible for rendering it.
However, it is still required to wrap the active tab content in KTabs
. Otherwise, even though tabs may seem to function correctly at first glance, accessibility would be broken.
Place the router view outside of KTabs
Place the router view to KTabs
default slot
When there are two or more tabbed interfaces on one page, it is important to identify each one of them with an ID unique in regard to the page. Otherwise, some a11y features may break.
+ +This is achieved by providing a unique value to tabsId
property:
There are several ways to adjust tabs styling. You can refer to the props and slots overview below and also to
KTabs
as well
+ Displays the tab list of a tabbed interface:
+ +KTabsList
is meant to be used together with
Tab list items are rendered as buttons. Tab panels' content is passed via tabs
array. The component takes care of displaying only content corresponding to the active tab.
Each tabbed interface needs to have ariaLabel
or ariaLabelledBy
and also an identifier, tabsID
, that is unique in regard to a page where tabs are rendered. Another purpose of tabsId
is to link KTabsList
and activeTabId
.
When implementing tabs with the router, it's the router view rather than
In such a case, define to
property with a router link object as its value in objects of the tabs
array:
Then, tabs will be rendered as router links and you can use the router view to display the active tab content:
+ +Note that here, tabs content is not passed to
However, it is still required to wrap the active tab content in
Place the router view outside of
Place the router view to
When there are two or more tabbed interfaces on one page, it is important to identify each one of them with an ID unique in regard to the page. Otherwise, some a11y features may break.
+ +This is achieved by providing a unique value to tabsId
property:
There are several ways to adjust tabs styling.
+ +Using props is the most straightforward:
+ +When that's not sufficient, appearanceOverrides
and appearanceOverridesActive
can be used, where the former complements or overrides styles common to all tabs and the latter contains styles specific to an active tab:
Lastly, the tab
slot can be used to adjust labels, for example to add icons. It's a scoped slot that exposes tab
object and isActive
boolean value:
KTabsList
A part of a tabbed interface that displays content associated with the active tab. It is meant to be used together with KTabsPanel
.
KTabsPanel
and contains detailed guidance on using both these componentsTabs are a design pattern describing a set of tab elements and panels containing content associated with them. Only one panel, the one corresponding to the active tab, is displayed at a time.
+ +They can be implemented by means of the following components:
+