Page header

The top of a page: back and forward, the path as the title, the page's own tools on the right, and one line across the window under it.

Part of a window with a page header, Home then Downloads in large type with Back and Forward before it and Search Downloads on the right, over a list headed Today.

Use it once at the top of every page of an app that has pages one level deep: a folder in Files, an artist in Music. The path is the title, and Back returns. For what is shown on the page below it (the count, the order, the views), use a view bar, not more tools in the header.

Anatomy

A page header with numbered callouts under it: Back and Forward, the parents, the page itself, the tools, and the line.
A header with a path of two levels and a search field.
  1. Back and forwardTwo icon buttons at 22 pixels. A button with nowhere to go is disabled: in the faint ink, out of the Tab order, and it does nothing.
  2. ParentsThe parents in the path, outermost first, in the secondary ink, each followed by a small ›. Pressing one goes there. In code they are crumbs.
  3. This pageStrong, in the main ink. When the path is too long for the room, this is what shortens, at its end.
  4. ToolsThe page's own tools, right-aligned: usually a search field. Put them inside the header.
  5. LineOne hairline under the header, starting in line with the buttons and running to the window's edge.

The path is set in Tacit Sans Display at headline size, 30 pixels.

States

Four page headers, numbered: at rest, with Forward available, at the first page with both buttons disabled, and while the page is still being read with an accent stretch along the line.
  1. At restBack is available, Forward is not.
  2. Forward availableAfter going back, Forward is lit.
  3. First pageBoth buttons are disabled, in the faint ink.
  4. ReadingWhile a slow page is being read (loading), a 2-pixel stretch in the accent, 220 pixels long, runs along the line every 1.4 seconds (sweep). The rows appear as they are read. There is no spinner on the page. With Kit.reducedMotion the stretch stands still at the line's start.

A parent under the pointer goes from the secondary to the main ink, and with the keyboard it has the focus ring.

Sizes

A page header at one and a half times its size with its height of 72 pixels, 16 pixels before the buttons and 24 after the tools.
A header at 1.5 times its size.
PartValue
Height72, and the line under it, 1
From the left16 pixels
Back and forward22-pixel symbols in 36-pixel buttons, 4 apart
The path30 pixels (headline), Tacit Sans Display, 8 pixels between its parts; it starts 16 after Forward
ToolsRight-aligned, 24 from the right, 24 apart
Line1 pixel, the hairline ink

Keys and pointer

Do thisTo
TabMove between Back, Forward, the parents and the tools; each is a stop
Enter or SpacePress the button, or go to the parent, that has the keyboard
Click a parentGo there

Accessibility

Writing

Name the page as it is: the folder's name, the artist's name, the drive's name. Do not add a subtitle or a count under it: a count goes in the view bar. Keep a parent's name as it is where it is the title of its own page, so people see the same word in both.

Do and don't

A header whose title is the path, Home then Music, one line under Back and Forward.
DoLet the path be the title. It says where you are and the parents are the way up.
A header with the title Music and a second line under it, 177 songs, 12 hours.
Don'tPut a subtitle under the title. A header is one line, and a count belongs where it matters, in the view bar or in a selection.

Code

import Tacit.Kit

PageHeader {
    width: parent.width
    crumbs: ["Home"]                     // the parents, outermost first
    here: "Downloads"
    canGoBack: history.canGoBack
    canGoForward: history.canGoForward
    loading: folder.reading
    onBack: history.back()
    onForward: history.forward()
    onCrumbPicked: i => go(path.slice(0, i + 1))
    SearchField { anchors.verticalCenter: parent.verticalCenter; scope: "Downloads" }
}
Property or signalWhat it does
crumbs, hereThe parents in the path, outermost first, and the page's own name
canGoBack, canGoForwardWhether each button works (Back is on, Forward off, by default)
loadingRuns the accent stretch along the line
fullHeight73: the header and its line. Read-only
back(), forward(), crumbPicked(index)The buttons and a pressed parent; the index is its place in crumbs
Content of the headerThe page's tools, right-aligned

Experimental, in Tacit.Kit 0.1.