Vivid API

Navigation

A navigation component makes it easy for users to navigate through your application. Nav accepts Nav Item and Nav Disclosure elements as children.

Usage

import { registerNav, registerNavItem, registerNavDisclosure } from '@vonage/vivid-api';
registerNav('your-prefix');
registerNavItem('your-prefix');
registerNavDisclosure('your-prefix');

Href

Use href to set the URL that the Nav Item links to.

Current

Use the current attribute on Nav Item to indicate the currently active link.

Use the current attribute on Nav Disclosure to indicate the currently active disclosure.
Only when the Nav Disclosure is closed the current will be set.

The aria-current prop is deprecated in both Nav Item and Nav Disclosure (as of 05/25) and directly replaced with current. aria-current is still functional in the component, but will be removed in a future major release. This will be communicated when it’s removal becomes a release candidate at the end of the support period.

Open

Use the open attribute to toggle the Nav Disclosure open state.

Slots

Meta Slot

Use the meta slot to add additional content to the Nav Item and the Nav Disclosure.

Icon Slot

Set the icon slot to add an icon to the Nav Item and the Nav Disclosure. If set, the icon attribute is ignored.

API Reference

nav

Slots

NameDescription
defaultDefault slot.
NameDescription
defaultDefault slot.

nav-item

Properties

PropertyTypeDefaultDescription
appearance'ghost' | 'ghost-light'Sets the nav item's appearance
connotation'accent' | 'cta'Sets the connotation color of the selected nav item
currentbooleanSets the nav item as a current
downloadstringPrompts the user to save the linked URL. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
hrefstringThe URL the hyperlink references. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
hreflangstringHints at the language of the referenced resource. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
pingstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
referrerpolicystringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
relstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
target'_self' | '_blank' | '_parent' | '_top'See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
textstringText of the nav item
typestringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
PropertyTypeDefaultDescription
appearance'ghost' | 'ghost-light'Sets the nav item's appearance
connotation'accent' | 'cta'Sets the connotation color of the selected nav item
currentbooleanSets the nav item as a current
downloadstringPrompts the user to save the linked URL. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
hrefstringThe URL the hyperlink references. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
hreflangstringHints at the language of the referenced resource. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
pingstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
referrerpolicystringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
relstringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
target'_self' | '_blank' | '_parent' | '_top'See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.
textstringText of the nav item
typestringSee https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element for more information.

Slots

NameDescription
iconThe preferred way to add an icon to the component.
metaA slot to add additional content to the nav item.
NameDescription
iconThe preferred way to add an icon to the component.
metaA slot to add additional content to the nav item.

nav-disclosure

Properties

PropertyTypeDefaultDescription
appearance'ghost' | 'ghost-light'The appearance nav-disclosure should have.
connotation'accent' | 'cta'The connotation nav-disclosure should have.
currentbooleanIndicates there's a nested active nav-item within nav-disclosure
labelstring
openbooleanIndicates whether the nav-disclosure is open
PropertyTypeDefaultDescription
appearance'ghost' | 'ghost-light'The appearance nav-disclosure should have.
connotation'accent' | 'cta'The connotation nav-disclosure should have.
currentbooleanIndicates there's a nested active nav-item within nav-disclosure
labelstring
openbooleanIndicates whether the nav-disclosure is open

Slots

NameDescription
defaultDefault slot.
iconThe preferred way to add an icon to the component.
metaA slot to add additional content to the nav disclosure.
NameDescription
defaultDefault slot.
iconThe preferred way to add an icon to the component.
metaA slot to add additional content to the nav disclosure.

Events

NameTypeDescription
toggleCustomEvent<undefined>Event emitted when the nav disclosure is toggled.
NameTypeDescription
toggleCustomEvent<undefined>Event emitted when the nav disclosure is toggled.