Defines different styles for a sub navigation.
Use the vk-subnav
component with vk-subnav-item
as items within the list.
<vk-subnav>
<vk-subnav-item title></vk-subnav-item>
<vk-subnav-item title></vk-subnav-item>
<vk-subnav-item title disabled></vk-subnav-item>
</vk-subnav>
Note For a better layout, if items should wrap into the next row, use the Margin directive.
Set the divided
prop to separate menu items with lines.
<vk-subnav divided>...</vk-subnav>
Set the pill
prop to highlight the active menu item with a background.
<vk-subnav pill>...</vk-subnav>
You can also use a dropdown from the Dropdown component with vk-subnav-item-dropdown
.
<vk-subnav>
<vk-subnav-item-dropdown title>
<vk-nav-dropdown>...</vk-nav-dropdown>
</vk-subnav-item-dropdown>
</vk-subnav>
By default the active item state is internal but you can sync it with your context using the active-item
prop. To easier identify the items set a unique key to each of them, otherwise they id will default to their index
.
<vk-subnav :active-item.sync>
<vk-subnav-item title key="first"></vk-subnav-item>
<vk-subnav-item title key="second"></vk-subnav-item>
<vk-subnav-item title key="third"></vk-subnav-item>
</vk-subnav>
Name | Type | Default | Description |
---|---|---|---|
activeItem | String, Number | -- | The currently active item. If omitted, the active state will remain internal. |
divided | Boolean | false | Displays modifier that separate the items with lines. |
pill | Boolean | false | Displays modifier that highlight the active item with a background. |
Name | Type | Default | Description |
---|---|---|---|
title | String | -- | The title to display. |
active | Boolean | false | Displays the item as active. |
disabled | Boolean | false | Displays the item as disabled. |
Name | Type | Default | Description |
---|---|---|---|
title | String | -- | The title to display. |
disabled | Boolean | false | Displays the item as disabled. |
disabled | Boolean | false | Displays the item as disabled. |
... | -- | -- | This component inherits the Drop Component props. |