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/ui/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
labelReactNode—The name of the row, where a row's label starts
valueReactNode—The current value, at the end of the row in the secondary label color. `0` shows; `null`, `undefined`, `false` and `""` do not
descriptionReactNode—A line under the label; the row grows from 52px to hold it. A `<br />` starts a second line
leadingReactNode—What leads the row, such as an `Avatar` or a picture: a column before the label, on the label's first line (a taller avatar starts at its top); the line above the row starts after it, where the text starts
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
hrefstring—Where the row goes: with it the row is a link, through the `linkComponent` of `PlexUIProvider`
asPlexUI.LinkComponent—The link component for `href`, such as a router's link
target, rel, downloadstring—Attributes of the link, with `href`
externalboolean—Treats `href` as a link 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
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
onClick(event: MouseEvent) => void—Called when the row is pressed
refRef<HTMLButtonElement | HTMLAnchorElement>—The pressable of the row: the button, or the element of the link
classNamestring—CSS classes applied to the pressable

Every other attribute (an id, events, ARIA and data attributes) goes to the pressable too. 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)