Navigation

Build app navigation with groups and collapsible submenus.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-nav>
  <sy-nav-group title="Workspace">
    <sy-nav-item value="overview">Overview</sy-nav-item>
    <sy-nav-item value="members">Members</sy-nav-item>
    <sy-nav-item value="settings" disabled>Settings</sy-nav-item>
  </sy-nav-group>
  <sy-nav-sub title="Project" open>
    <sy-nav-item value="website">Homepage</sy-nav-item>
    <sy-nav-sub title="Component">
      <sy-nav-item value="core">Design System</sy-nav-item>
      <sy-nav-item value="charts">Charts</sy-nav-item>
    </sy-nav-sub>
  </sy-nav-sub>
</sy-nav>

Usage guide

#

A persistent navigation menu between the app's main views. Use Menu or Dropdown for temporary command lists.

Always-visible groups

Use nav-group to create menu groups with headings.

Collapsible submenus

Use nav-sub to expand and collapse child items.

Feature examples

#

Choose a feature from 18 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Group Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Item Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Sub Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Group Attributes / Title

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Item Attributes / Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Item Attributes / Value

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Sub Attributes / Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Sub Attributes / Open

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Sub Attributes / Title

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Sub Attributes / Value

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Methods · Item Methods / ParentDisabled

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Item Methods / SetActive

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Sub Methods / ParentDisabled

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Sub Methods / SetClose

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Sub Methods / SetOpen

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Sub Methods / SetTrigger

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

API reference

#

Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.

<sy-nav>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalseBlock user interaction and keyboard focus.

Slots

SlotDescription
Component body or child items.

<sy-nav-item>

Properties

Attribute / PropertyTypeDefaultDescription
string''Current value or item identifier.
booleanfalseBlock user interaction and keyboard focus.
number0Menu indentation level, calculated by the parent menu.

Events

EventDetailDescription
CustomEvent<string>Value of the activated navigation item. The application owns routing.

Methods

MethodReturnsDescription
Promise<void>Pass down the parent menu's disabled state. Normally managed by the parent.
Promise<void>Set item styling within a menu group. Managed by the parent.
Promise<void>Change the menu item's selection indicator.

Slots

SlotDescription
Component body or child items.

<sy-nav-sub>

Properties

Attribute / PropertyTypeDefaultDescription
string''Title of the collapsible submenu. The HTML attribute is title.
string''Current value or item identifier.
booleanfalseWhether the submenu is expanded.
booleanfalseBlock user interaction and keyboard focus.
number0Menu indentation level, calculated by the parent menu.

Events

EventDetailDescription
CustomEvent<string>Submenu value, emitted when its expanded state changes.

Methods

MethodReturnsDescription
Promise<void>Pass down the parent menu's disabled state. Normally managed by the parent.
Promise<void>Set item styling within a menu group. Managed by the parent.
Promise<void>Expand or collapse the submenu.
Promise<void>Expand the submenu.
Promise<void>Close the item.

Slots

SlotDescription
Component body or child items.

<sy-nav-group>

Properties

Attribute / PropertyTypeDefaultDescription
string''Menu group title. The HTML attribute is title.
number0Menu indentation level, calculated by the parent menu.

Slots

SlotDescription
Component body or child items.