Skip to content

Top Nav Item

@astryxdesign/core v0.7.1 · TopNavItem

Props ​

PropTypeDefaultDescription
labelstring—Accessible label for the nav item. Rendered as visible text by default. When isIconOnly is true, it becomes the aria-label instead. Required.
hrefstring—Navigation target URL.
asNavLinkComponent'a'Custom link root component, such as RouterLink. It receives the address as to as well. Used only when there is an address.
targetstring—Link target. A new-window target also adds noopener noreferrer.
relstring—Link rel. Merged with the noopener noreferrer that a new-window target adds.
iconClassstring—Icon shown before the label, given as a CSS icon class such as i-carbon-home.
isSelectedbooleanfalseWhether this nav item is currently selected. Sets aria-current="page" and applies highlighted styles.
isDisabledbooleanfalseWhether the nav item is disabled. Sets aria-disabled, drops href/target so the item cannot navigate, and prevents interaction.
isIconOnlybooleanfalseRenders the item as a square icon-only element. When true, label becomes the aria-label and the visible text is hidden. Inside the mobile drawer the label is shown again.
sizeNavItemSize'md'Height and horizontal padding of the item: 'sm' is 28px, 'md' 32px, 'lg' 36px.

Events ​

  • click(event: MouseEvent): fires when the item is clicked. A disabled item blocks the default action and emits nothing.