Skip to the content

Kongens Nytorv

Metro M1, M2 and M3.

Nørreport

Variants and states

Rest
Outlined
Nørreport
Filled
Nørreport
  • Rest
    Nørreport

Sizes

Nørreport
Medium
Nørreport
Small
Nørreport
Large

Props

NameTypeDefaultDescription
variant'outlined' | 'filled''outlined'outlined is a ring around the surface colour, for any stop; filled is a solid dot in the line's colour, for the one stop that matters most, such as the vehicle's next stop.
line'm1' | 'm2' | 'm3' | 'm4' | 'a' | 'b' | 'c' | 'e' | 'f' | 'h' | 'bus' | 'regional'—The line or mode whose colour the marker takes: a metro or S-tog line by its id, or bus or regional for every line of that mode. Left out, the marker is neutral, for a station several lines serve.
size'small' | 'medium' | 'large''medium'The marker's diameter: small beside caption and label text, as on a stop timeline; medium inside controls and rows; large beside a panel title. The three sizes are the three icon sizes, so the marker matches an icon beside the same text.
classNamestring—Merged after pn-StationIcon on the root
styleCSSProperties—Reaches the root
refRef<HTMLSpanElement>—Reaches the root
variant'outlined' | 'filled', default 'outlined'
outlined is a ring around the surface colour, for any stop; filled is a solid dot in the line's colour, for the one stop that matters most, such as the vehicle's next stop.
line'm1' | 'm2' | 'm3' | 'm4' | 'a' | 'b' | 'c' | 'e' | 'f' | 'h' | 'bus' | 'regional', default —
The line or mode whose colour the marker takes: a metro or S-tog line by its id, or bus or regional for every line of that mode. Left out, the marker is neutral, for a station several lines serve.
size'small' | 'medium' | 'large', default 'medium'
The marker's diameter: small beside caption and label text, as on a stop timeline; medium inside controls and rows; large beside a panel title. The three sizes are the three icon sizes, so the marker matches an icon beside the same text.
classNamestring, default —
Merged after pn-StationIcon on the root
styleCSSProperties, default —
Reaches the root
refRef<HTMLSpanElement>, default —
Reaches the root

Use it

import { StationIcon } from '@mylder/perron'

Ask your agent

search_docs({ query: "StationIcon" })

Keyboard and ARIA

No Base UI part, so nothing from Base UI here: the marker is decorative, never focusable, and hidden from assistive technology.

KeyDoesFrom
NoneThe marker takes no focus and no keys; Tab passes it byPerron
ElementRoleAccessible name fromStates announced
rootNone: aria-hidden="true", hiddenNone: the stop's name, and the line's, are the caller's text beside itNone

StationIcon is always decorative: Perron sets aria-hidden="true" after the rest props so it wins over them (a render element's own props merge last, as CR-3 says), with no accessible name and no label prop, as an icon next to text is (Icons). It always sits beside the stop's name, and the line is named in words nearby, so it adds nothing for the ear.

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 marker tells the eye the line's colour and, filled, which stop matters; the caller's text beside it names the stop and the line, and a filled stop's meaning (such as "Next stop"), as Do and don't says
  • Every landmark and named region has an accessible name: none here, the marker is not a region
  • Every default label can be overridden: none here, the marker owns no label
  • Every shape the type accepts renders, in every variant: every line value, and none, in both variants and all three sizes, shown by the Lines story and the six variant stories
  • A hidden copy kept for animation is aria-hidden, and a collapsed region is inert: none here, nothing animates or collapses
  • Native semantics first: a plain <span> with aria-hidden="true", no role
  • Focus moves in reading order and returns on close: the marker is never focused, so focus passes it in reading order
  • Every target is at least size.target-min square: none here, the marker is not a target; a caller that makes a stop pressable makes its whole row the target
  • Loops stop when the system asks for less motion: none here, nothing moves

Owned strings

No owned strings: the marker shows and announces no words, and the stop's and line's names come from the caller beside it.

Do and don't

For a caller using the component, 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-1mustPut the marker beside the stop's name, with the line named in words nearby, because the marker is hidden from screen readersUse it alone, or as the only sign of which line serves a stop: colour is never alone (Accessibility)review
DD-2mustLeave line out for a station several lines serve, so the marker is neutralPick one of several lines' colours for a shared station, which tells the eye only one line stops therereview
DD-3mustUse filled for the one stop that matters most in a list, such as the next stop, and say why in words beside itFill several stops in one list, or use filled to mean a state the words don't sayreview
DD-4mustUse a LineBadge to name a lineUse a StationIcon as a line's badge or swatch in a row of badges, where it reads as a stopreview
DD-5shouldPick the size that matches the text beside it: small for captions, medium for labels, large for panel titlesResize it with className or a raw width, which breaks the ring's weight against its icon-sized neighboursreview
DD-6mustMake the whole row pressable when a stop opens something, at least size.target-min tallMake the marker itself a button or link: it is too small a target and has no namereview