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
Leading
Columns
API
NavigationRow
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | — | The name of the row, where a row's label starts |
value | ReactNode | — | The current value, at the end of the row in the secondary label color. `0` shows; `null`, `undefined`, `false` and `""` do not |
description | ReactNode | — | A line under the label; the row grows from 52px to hold it. A `<br />` starts a second line |
leading | ReactNode | — | 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 |
disclosure | boolean | true | The 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 |
href | string | — | Where the row goes: with it the row is a link, through the `linkComponent` of `PlexUIProvider` |
as | PlexUI.LinkComponent | — | The link component for `href`, such as a router's link |
target, rel, download | string | — | Attributes of the link, with `href` |
external | boolean | — | Treats `href` as a link out of the app (a new tab) |
disabled | boolean | false | The 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 |
ref | Ref<HTMLButtonElement | HTMLAnchorElement> | — | The pressable of the row: the button, or the element of the link |
className | string | — | 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 withcolumns)--navigation-row-disclosure-color: the chevron (default the tertiary label color)--navigation-row-leading-size: the column ofleading, its own size (default40px, an avatar;28pxfor a symbol)--navigation-row-leading-gap: fromleadingto the text (default12px)