Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

On a page

Put the rail beside the content it filters, and mark the page the visitor is on so the rail shows where they are.

A mailbox rail
Show code
<app-nav-list label="Mailboxes">
    <app-nav-list-item href="/inbox" icon="mail" count="3" active="true">Inbox</app-nav-list-item>
    <app-nav-list-item href="/starred" icon="star">Starred</app-nav-list-item>
    <app-nav-list-divider />
    <app-nav-list-item dot-tone="Tone.Info">Sales</app-nav-list-item>
</app-nav-list>

Row kinds

A row is a link with a target, a button without one, and it takes an icon or a dot, plus a count when there is one.

Link, current and button rows
Show code
<app-nav-list label="Row kinds">
    <app-nav-list-item href="#docs" icon="chart">Docs</app-nav-list-item>
    <app-nav-list-item href="#pricing" icon="chart" active="true">Pricing</app-nav-list-item>
    <app-nav-list-item>Archive</app-nav-list-item>
</app-nav-list>
Dot and count
Show code
<app-nav-list label="Dot and count">
    <app-nav-list-item dot-tone="Tone.Primary" count="7">Team</app-nav-list-item>
</app-nav-list>

Every option

Every value of every prop, one cell each.

label

label: names the landmark, not drawn

items

items: no rows (default), an empty rail
items: one app-nav-list-item per row (React items)

to / href

href: link row
no href: button row

icon

icon="chart"

dotTone

dot-tone="primary"
dot-tone="info"
dot-tone="success"
dot-tone="warning"
dot-tone="danger"
dot-tone="neutral"

count

count="7", with a dot
count="0", hidden

active

active="false" (default)
active="true", the current row

divider

<app-nav-list-divider />, a hairline between groups

linkComponent

linkComponent: React only, rows are plain links

className

class: adds a class to the nav, no visible change

Guidance

What to do, and what to avoid.

Use it when

  • A page has a short rail of destinations or groups, each with a count, beside its content.
  • The rows pick one current destination, and some rows are coloured by a status dot.

Reach for something else when

  • A site's top navigation with dropdown panels. → AppNavigationMenu
  • A signed-in app's sidebar of destinations. → AppShell
  • A choice between several values in a form. → AppRadioGroup

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

React, generated from the controls
<AppNavList label="Lists"
  items={[
    { key: 'inbox', label: 'Inbox', to: '#inbox', icon: 'mail', count: 3, active: true },
    { key: 'starred', label: 'Starred', to: '#starred', icon: 'star' },
    { key: 'scheduled', label: 'Scheduled', to: '#scheduled', icon: 'calendar', count: 0 },
  ]}
/>
Razor, the same props
<app-nav-list>…</app-nav-list>

6 props. The 1 most used come first.

Used on most screens 1 props

PropTypeDefaultDescription
labeldefault required string required The accessible name of the navigation landmark.

Less common 5 props

PropTypeDefaultDescription
hrefdefault - string - On a row: where it links. Without it the row is a button.
icondefault - string - On a row: a library icon name, drawn at 18 px. Not together with dot-tone.
dot-tonedefault - string - On a row: primary, info, success, warning, danger or neutral, a 10 px dot in place of the icon.
countdefault - number - On a row: a count on the right; hidden when null or 0.
activedefault false boolean false On a row: tints it and sets aria-current="page".

Screen reader

2 notes
  • The rows sit in a navigation landmark named by label, and the current row is marked with aria-current page.
  • A dot is decorative: the row's label carries the meaning, so the dot is hidden from assistive tech.