Skip to the content
Mylder
  • Vehicles on the map
    1 204
  • Reporting live
    1 046
  • Average delay
    2 min

Props

NameTypeDefaultDescription
time*string—The time the clock shows, 24-hour HH:MM, such as '08:14', in Copenhagen's time. Required. The caller updates it each minute; KioskBar keeps no clock of its own.
statsreadonly KioskBarStat[][]The key figures, in the order they show: each one's label and figure. Left out or empty, the bar shows the brand and the clock alone.
brandNameLabelstringThe locale'sOverrides "Mylder", the brand name; given to the Brand
unknownLabelstringThe locale'sOverrides "Unknown", heard in place of "—" for a figure with no data; given to every Stat
classNamestring—Joined after pn-KioskBar on the root
styleCSSProperties—Reaches the root
refRef<HTMLDivElement>—Reaches the root element
slotProps{ brand?: Omit<BrandProps, "brandNameLabel" | "render"> | undefined; stats?: DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement> | undefined; stat?: Omit<StatProps, "children" | "label" | "render" | "unknownLabel"> | undefined; time?: DetailedHTMLProps<TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement> | undefined; }—Props for each part: brand, stats, stat, time.
time (required)string, default —
The time the clock shows, 24-hour HH:MM, such as '08:14', in Copenhagen's time. Required. The caller updates it each minute; KioskBar keeps no clock of its own.
statsreadonly KioskBarStat[], default []
The key figures, in the order they show: each one's label and figure. Left out or empty, the bar shows the brand and the clock alone.
brandNameLabelstring, default The locale's
Overrides "Mylder", the brand name; given to the Brand
unknownLabelstring, default The locale's
Overrides "Unknown", heard in place of "—" for a figure with no data; given to every Stat
classNamestring, default —
Joined after pn-KioskBar on the root
styleCSSProperties, default —
Reaches the root
refRef<HTMLDivElement>, default —
Reaches the root element
slotProps{ brand?: Omit<BrandProps, "brandNameLabel" | "render"> | undefined; stats?: DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement> | undefined; stat?: Omit<StatProps, "children" | "label" | "render" | "unknownLabel"> | undefined; time?: DetailedHTMLProps<TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement> | undefined; }, default —
Props for each part: brand, stats, stat, time.

Use it

import { KioskBar } from '@mylder/perron/patterns'

Ask your agent

search_docs({ query: "KioskBar" })

Keyboard and ARIA

KioskBar has no keys of its own and nothing in it is focusable: a kiosk is read, not operated. Tab passes the bar by.

KeyDoesFrom
NoneThe bar takes no focus and no keys; Tab passes it byPerron
ElementRoleAccessible name fromStates announced
rootNone (generic div)NoneNone
brandNone (Brand's span)Its text: "Mylder", from the wordmark or Brand's hidden labelNone
statsListNone; its items are countedNone
statList itemIts text: the label, then the figure or "Unknown"None
timeTime, the role ARIA gives the elementIts text, "08:14"None

The root is a plain div, not a landmark or named region, so KioskBar owns no string of its own: a pattern can't swap its element without render, a landmark's name would be a new owned string in four locales for a display no one browses, and the screen that shows kiosk mode wraps the bar in the landmark its page needs, as DetailHeader leaves the region to DetailPanel.

The clock is not a live region and the figures are not either: the time turns every minute and the figures update often, which would flood a screen reader, and Accessibility asks that only changes of state be announced, in the screen's own polite live region.

What axe won't catch, from the contract, each with how this component meets it:

  • Everything the eye is told, the ear is told, for every shape each prop accepts: the brand is heard as "Mylder" in both of Brand's variants, full in the Default story and mark in Narrow; each figure is heard after its label, and an unknown one as "Unknown" in place of the hidden "—", both from Stat; the clock is its own text. No colour carries meaning.
  • Every landmark and named region has an accessible name: none here; the root is not a landmark, and the screen that wraps it in one names it.
  • Every default label can be overridden: brandNameLabel for the brand name and unknownLabel for every unknown figure.
  • Every shape the type accepts renders, in every variant: each entry's label and figure render a string, a number, an element and a list alike, as Stat's do; stats left out, empty and with one to four entries; slotProps.brand with variant='mark'. KioskBar.test.tsx renders each shape of label and figure, stats left out and empty, and one to four entries.
  • A hidden copy kept for animation is aria-hidden, and a collapsed region is inert: none here; nothing animates or collapses. Brand's mark and Stat's "—" are hidden because words beside them say them, not for animation.
  • Native semantics first: a ul of li for the figures, a time element for the clock, plain div and span for the rest, and no ARIA of the pattern's own.
  • Focus moves in reading order and returns on close: nothing takes focus or opens; the DOM order, brand, figures, clock, is the order on screen.
  • Every target is at least size.target-min square: no target; nothing in the bar is pressed.
  • Loops stop when the system asks for less motion: none here; nothing moves, and the clock changes its text without a transition.

Owned strings

KioskBar owns no new string: every word comes from the caller, through time and stats, or from the components it composes, whose keys it reuses from packages/perron/src/locale/en.ts.

KeyEnglishOverrideSeen or heard where
brandName"Mylder"brandNameLabelThe brand part: Brand's wordmark, shown lowercase, or its hidden label with variant='mark'
unknown"Unknown"unknownLabelA stat part whose entry has no figure: heard in place of Stat's hidden "—"

Do and don't

For a caller using the pattern, with the reason. Each row is a rule: a must row's Don't is never right, a should row's needs a reason, and Checked by says what catches the Don't in a caller's code.

RuleLevelDoDon'tChecked by
DD-1mustGive time in Copenhagen's time as HH:MM, and update it when the minute turnsPass the device's local time or a 12-hour time: the brand keeps the 24-hour clock, and a kiosk shows the city's timereview
DD-2shouldKeep to about four figures, each named in a few words: "Reporting live", "Average delay"Fill the bar with figures until it wraps on a wide screen: read from across a room, fewer figures read fasterreview
DD-3mustLeave out an entry's figure when no data gives it, so Stat shows "—" and says "Unknown"Pass 0 or a guess for a figure the data doesn't know: the brand never claims more than the data knowsreview
DD-4shouldPlace the bar from the screen, size.panel-gap from the edges at z-index.sheet, and wrap it in a landmark thereGive it a position, a margin or a z-index through className: the pattern sizes to its container and places nothingreview
DD-5mustPick slotProps.brand.variant 'mark' where the bar is tightHide the brand or its parts with className, which can leave a mark no screen reader hearsreview
DD-6mustAnnounce a change of state, such as a data feed problem, in the screen's own polite live regionMake the clock or the figures a live region: they change every minute and would flood a screen readerreview
DD-7shouldUse the top bar's clock, in typography.data-lg, on a screen people operateUse KioskBar on a screen people touch or tab through: it has no controls and its clock is sized for a room, not a deskreview