Tab Nav

To create a tab navigation, use the <TabNav> and <TabNavItem> components.

Properties and Slots

TabNav

Properties

Name
Description
active
The name of the active tab.

Slots

Name
Description
default
The content of the tab nav.

TabNavItem

Properties

Name
Description
name
The name of the tab.
active
Set to true to make the tab active (optional). Only use if you want to control the active tab from outside.

Slots

Name
Description
default
The content of the tab.
start
The content of the start slot (left side).
end
The content of the end slot (right side).

Usage

<script lang="ts">
    import { TabNav, TabNavItem } from '@hyvor/design';
    let active = 'settings';
</script>

<TabNav bind:active={active}>
    <TabNavItem name="settings">
        <IconGear slot="start" />
        Settings
    </TabNavItem>
    <TabNavItem name="seo">
        <IconSearchHeart slot="start" />
        SEO
        <Tag size="x-small" color="green" slot="end">80%</Tag>
    </TabNavItem>
    <TabNavItem name="links">
        <IconLink45deg slot="start" />
        Links
    </TabNavItem>
</TabNav>
Table of Contents