The bar a Mylder screen in kiosk mode shows over the map, for a display people read from across a room and never touch: the Mylder brand, a few key figures about the network, and the clock, large.
When to use
Use KioskBar for the bar over the map on a screen in kiosk mode, which people read from across a room and never touch: the brand, a few key figures and the clock, large.
- Vehicles on the map1 204
- Reporting live1 046
- Average delay2 min
Props
| Name | Type | Default | Description |
|---|---|---|---|
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. |
stats | readonly 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. |
brandNameLabel | string | The locale's | Overrides "Mylder", the brand name; given to the Brand |
unknownLabel | string | The locale's | Overrides "Unknown", heard in place of "—" for a figure with no data; given to every Stat |
className | string | — | Joined after pn-KioskBar on the root |
style | CSSProperties | — | Reaches the root |
ref | Ref<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-KioskBaron 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.
| Key | Does | From |
|---|---|---|
| None | The bar takes no focus and no keys; Tab passes it by | Perron |
| Element | Role | Accessible name from | States announced |
|---|---|---|---|
root | None (generic div) | None | None |
brand | None (Brand's span) | Its text: "Mylder", from the wordmark or Brand's hidden label | None |
stats | List | None; its items are counted | None |
stat | List item | Its text: the label, then the figure or "Unknown" | None |
time | Time, the role ARIA gives the element | Its 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,
fullin theDefaultstory andmarkinNarrow; 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:
brandNameLabelfor the brand name andunknownLabelfor every unknown figure. - Every shape the type accepts renders, in every variant: each entry's
labelandfigurerender a string, a number, an element and a list alike, as Stat's do;statsleft out, empty and with one to four entries;slotProps.brandwithvariant='mark'.KioskBar.test.tsxrenders each shape oflabelandfigure,statsleft out and empty, and one to four entries. - A hidden copy kept for animation is
aria-hidden, and a collapsed region isinert: 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
uloflifor the figures, atimeelement for the clock, plaindivandspanfor 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-minsquare: 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.
| Key | English | Override | Seen or heard where |
|---|---|---|---|
brandName | "Mylder" | brandNameLabel | The brand part: Brand's wordmark, shown lowercase, or its hidden label with variant='mark' |
unknown | "Unknown" | unknownLabel | A 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.
| Rule | Level | Do | Don't | Checked by |
|---|---|---|---|---|
| DD-1 | must | Give time in Copenhagen's time as HH:MM, and update it when the minute turns | Pass the device's local time or a 12-hour time: the brand keeps the 24-hour clock, and a kiosk shows the city's time | review |
| DD-2 | should | Keep 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 faster | review |
| DD-3 | must | Leave 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 knows | review |
| DD-4 | should | Place the bar from the screen, size.panel-gap from the edges at z-index.sheet, and wrap it in a landmark there | Give it a position, a margin or a z-index through className: the pattern sizes to its container and places nothing | review |
| DD-5 | must | Pick slotProps.brand.variant 'mark' where the bar is tight | Hide the brand or its parts with className, which can leave a mark no screen reader hears | review |
| DD-6 | must | Announce a change of state, such as a data feed problem, in the screen's own polite live region | Make the clock or the figures a live region: they change every minute and would flood a screen reader | review |
| DD-7 | should | Use the top bar's clock, in typography.data-lg, on a screen people operate | Use KioskBar on a screen people touch or tab through: it has no controls and its clock is sized for a room, not a desk | review |