Native Web Components playground

Nova v3.38.0

Preview

Web Components

Horizontal navigation

A navigation bar across the top, for apps with a few main sections.

Overview#

The Vertical Navigation Template is designed for sidebars, especially in apps or admin panels with multiple sections.

A horizontal navigation with Home, Dashboard, which is active, Projects with a caret, Tasks with a count, and Documentation.

When to Use

  • As the primary navigation in an app or website
  • When there are 3–7 main navigation links
  • When vertical space is limited

States#

The horizontal navigation with numbered markers on four items: Home, Dashboard, Projects and Tasks.
  1. Default: Unselected, idle state of a item
  2. Active: The currently selected item
  3. Hover: The item being hovered over
  4. Disabled: A item that is not interactive or currently available

Anatomy (Figma)#

The horizontal navigation's anatomy, with marker 1 on an item and marker 2 on the navigation as a whole.
  1. <Nav horizontal | Item>: Partial component. Can be set to its state.
  2. [Nav horizontal]: Template component that can be detached if needed.

Extend the component#

A horizontal navigation whose Projects item is open, showing a menu with Home, an expanded Dashboard holding Projects A to C, and Tasks.

In Figma and in code, you can use the slot to enhance the template and display a menu.

  1. Replace a <Nav horizontal | item> or add the menu component in the template. You may detach it if needed.
  2. In the Menu component properties, swap the Trigger slot with a <Nav horizontal | item>

Look and feel#

Spark Theme

The horizontal navigation in the Spark theme, in light and dark mode.

Ocean Theme

The horizontal navigation in the Ocean theme, in light and dark mode.

This template has been completely built with intentional tokens, giving the ability to display the right color scheme accordingly to the theme and mode where it is deployed.

Best Practice#

  • Keep link labels short and scannable
  • Reserve right-aligned space for profile/actions if needed
  • Keep alignment consistent (use design tokens)

In code#

For Developers

This is purely layout markup — no JS logic is included.

Active state

To display one item as active, add the class “active” to the anchor.

Disabled state

To display one item as disabled, add the class “disabled” to the anchor.

Example

html<nav class="nv-navbar">
  <ul class="flex gap-x-0.5">
    <li>
      <a href="#" class="nv-link">
        <nv-icon name="home" size="md"> </nv-icon>
        Home
      </a>
    </li>
    <li>
      <a href="#" class="nv-link">
        <nv-icon name="layout-dashboard" size="md"> </nv-icon>
        Dashboard
      </a>
    </li>
    <li>
      <a href="#" class="nv-link active">
        <nv-icon name="stack" size="md"> </nv-icon>
        Projects
        <nv-icon name="chevron-down" size="sm"> </nv-icon>
      </a>
    </li>
    <li>
      <a href="#" class="nv-link">
        <nv-icon name="stack" size="md"> </nv-icon>
        Tasks
        <span
          class="nv-badge bg-feedback-warning-high text-feedback-warning-high rounded-full w-5 flex items-center justify-center text-sm"
        >
          3
        </span>
      </a>
    </li>
    <li>
      <a href="#" class="nv-link">
        <nv-icon name="notebook" size="md"> </nv-icon>
        Documentation
      </a>
    </li>
    <li>
      <a href="#" class="nv-link">
        <nv-icon name="headset" size="md"> </nv-icon>
        Support
      </a>
    </li>
    <li>
      <a href="#" class="nv-link disabled">
        <nv-icon name="contract" size="md"> </nv-icon>
        Contracts
      </a>
    </li>
  </ul>
</nav>