Skip to content

Machine-translated – improvements welcome. Suggest an improvement

Number

Zahl is the number after an entry of the navigation – in the filing area (To do, New post, Favourites, views) and in the workbench (areas). It follows principle 9 (pattern catalogue C14, #1287): yellow only for warnings, 0 is always shown.

What it is for

For the number after an entry of the navigation: what is waiting, how much is in it, or that there is a warning. A number on a page with a way to it is a Tile; a feature of an entry is a Tag; the count in a tab is carried by the Tabs themselves.

Matching patterns in the pattern catalogue: C14 · Kinds of buttons: fixed, the same everywhere (principle 9: numbers calm), B7 · Messages by severity, accepting is logged, D1 · Singular and plural.

How to use it

The number itself cannot be operated – it belongs to the navigation entry, and that is the link.

With How it works
Mouse A click on the entry (number included) opens it; a tooltip (title) appears on hover.
Keyboard Tab reaches the entry; the number is read with it.
Touch The touch target is that of the entry.

What it means

Rules (principle 9):

  • Yellow only for real warnings – “Overview” and “Automations” in the workbench when there are notes.
  • What is waiting for you (To do, New post): bold in text colour while it is more than 0; for screen readers with text, not only through the font weight.
  • Plain amounts (Favourites, Bin, views, numbers in the workbench): quiet grey.
  • 0 is always shown, quiet grey. Only while loading does the placeholder ZahlWarte stand there; an entry that does not exist right now (bin switched off) is left out.

For the person this means: bold – something is waiting for you here. Grey – that's how many there are, nothing to do. Yellow – something is not right here, take a look.

States

State How it comes about How it looks
amount art="menge" (default) quiet grey, also 0
waiting art="wartet" bold in text colour, no background; at 0 like an amount
warning art="warnung" yellow pill
loading ZahlWarte placeholder until the number arrives

“Number” section of the pattern page: waiting, empty new post, amounts and a warning

“Number” section, dark

Accessibility

If there is a text, the visible number is aria-hidden and the text is read instead: beschriftung (e.g. “1 – note in automations”), for wartet without one “{anzahl} waiting for you”. Otherwise the number itself is read. So “waiting” doesn't depend on the font weight alone, and the warning not on the colour alone.

Checked in the smoke test “Navigation: Zahlen ruhig” (web/rauchtest/bereiche/ruhige-werkbank.mjs): no warning in the filing navigation, “0” for empty new post, axe light and dark. The former global class .zaehler (yellow pill for everything) no longer exists.

Code

import { Zahl } from '../bausteine';

<Zahl wert={d.zaehler.eingang} art="wartet" />            // To do: bold in text colour, “2 waiting for you”
<Zahl wert={d.zaehler.favoriten} />                       // plain amount, quiet grey – also 0
<Zahl wert="!" art="warnung" beschriftung="! – automations paused" />
Property Meaning
wert number (written in the locale) or a short warning text (“!”, “off”)
art menge (default, quiet grey), wartet (bold in text colour, no background; at 0 like an amount), warnung (yellow pill)
beschriftung text for screen readers instead of the visible number; for wartet it defaults to “{anzahl} waiting for you”
title tooltip

Files and tests

  • Component: web/src/bausteine/zahl/Zahl.tsx, appearance: Zahl.module.css
  • Pattern page: web/src/bausteine/zahl/muster.tsx
  • Test: web/test/baustein-etikett.test.ts