Navigation Row

A row of a list that opens what it holds, as an iOS Settings row: its label, the current value at the end, a chevron, and the whole row one press.

import { NavigationRow } from "@plexui/vue/components/NavigationRow";

A navigation row leads into what it holds, as a row of iOS Settings does: General › Language shows the language in use and opens the list to change it. Use it for a setting whose choices or details need a page of their own; for a choice made in place, use a Select in a Field row, and for a row that does something at once, an action row (a ghost Button with block in a data-row).

Examples

Overview

General

Leading

People

Columns

General

API

PropTypeDefaultDescription
labelstring | number—The name of the row, where a row's label starts (or the `label` slot)
valuestring | number | null—The current value, at the end of the row in the secondary label color (or the `value` slot). `0` shows; `null`, `undefined` and `""` do not
descriptionstring | number—A line under the label; the row grows from 52px to hold it (or the `description` slot, where a `<br />` starts a second line)
tostring | object—A router target: with it the row is a link, through the `linkComponent` of `PlexUIProvider`
hrefstring—Where the row goes, as a plain link
asComponent | "a"—The link component, such as a router's link
externalboolean—Treats the link as one out of the app (a new tab)
disabledbooleanfalseThe row can't be pressed. A disabled link renders as a disabled button, so it never navigates
disclosurebooleantrueThe chevron at the end. `false` drops it, for a row that opens a record rather than a page of choices (the Contacts list of iOS); the row is still one press
valuePlacement"end" | "below" | "auto""end"Where the value stands: at the end of the row, under the label at the full width, or `auto`: at the end while it fits beside the label on one line, otherwise under it

Slots: label, value, description, in place of their props; leading, what leads the row (an Avatar or a picture) in a column before the label, on the label's first line (a taller avatar starts at its top), the line above the row starting after it.

Events: click, when the row is pressed.

Exposed: element, the pressable (the button, or the element of the link), and focus().

Every other attribute (an id, a class, listeners, ARIA and data attributes) goes to the pressable. The row says nothing of what it opens: a row that opens a dialog in place of a page sets aria-haspopup="dialog" and aria-expanded itself. The name the row reads with is its label, description and value in that order.

Styling

NavigationRow reads the row tokens of FieldGroup (--field-row-min-height, --field-row-padding-inline, --field-row-label-*, --field-row-description-*, --field-row-gap, --field-row-disclosure-gap) and five of its own. Override them at any scope to restyle it:

  • --navigation-row-label-color: the label (default the text color)
  • --navigation-row-value-color: the value (default the secondary label color; the text color with columns)
  • --navigation-row-disclosure-color: the chevron (default the tertiary label color)
  • --navigation-row-leading-size: the column of leading, its own size (default 40px, an avatar; 28px for a symbol)
  • --navigation-row-leading-gap: from leading to the text (default 12px)