A code language is metadata, never status, so its tag carries no hue.
NockerlLanguageBadge is the first-class, hue-free tag: a quiet lowercase monospace pill
(neutral soft wash + muted ink) shared by the CodeBlock header, the DiffViewer header, and the
Markdown code fence, so the tag reads identically everywhere. The label runs through the shared
nockerlLanguageLabel contract (trim + lowercase, blank → nothing). It is byte-identical to
the native rails, so 'TypeScript' renders typescript on every surface.
App-configurable color (a ratified relaxation)
The framework default stays hue-free and ships no per-language color map. Apps may
differentiate languages via the optional color prop (their own mapping: TS ≠ Kotlin ≠
Swift), and for this one case a status hue is permitted: a language color reads as
identity metadata, not state. Unset, the tag is the quiet neutral canon matching Android +
Voice.
Prop
Type
Default
Description
language
string | null
n/a
The language name in any casing (e.g. 'TypeScript'). Normalized to a lowercase tag by the shared nockerlLanguageLabel contract; a blank / absent value renders nothing.
color
string
n/a
OPTIONAL app-side tag color: tints the soft wash + the lettering via NockerlBadge's arbitrary-color path. The APP owns the language→color mapping; the framework never hardcodes one. Unset = the neutral default.
size
NockerlBadgeSize
'sm'
Badge scale. Defaults to sm (the code-header pill size).
Also accepts the native <span> attributes (e.g. onClick, disabled, id, aria-*, data-*), forwarded straight through, plus a forwarded ref.
Override the tone hue with an ARBITRARY color (e.g. a per-language code color the 6 fixed tones can't express). Drives the soft tint/label/border (or the solid fill). Falls back to tone when unset.
mono
boolean
false
Render the label in the monospace family (for code / file-type / version pills).
size
NockerlBadgeSize
'md'
NockerlBadge scale.
max
number
99
Overflow ceiling for count (e.g. 99 → 99+).
anchored
boolean
false
Pin to the parent host's top-right corner (overlapping, ringed). The parent must be the positioned host (the demo's Anchored wrapper provides it). Else the badge renders inline.
ariaLabel
string
n/a
Accessible name announced for the badge when it stands alone (e.g. "3 unread"). When the badge is anchored, name the HOST instead and leave this unset. The count is decorative there.
Also accepts the native <span> attributes (e.g. onClick, disabled, id, aria-*, data-*), forwarded straight through, plus a forwarded ref.
The published NockerlBadge ships as a first-class wrapper with three forms; tones map onto
semantic palette slots via NockerlBadgeTone (never a raw hue).
Parameter
Type
Default
Description
NockerlBadge(count, tone, contentDescription) *
Int, NockerlBadgeTone, String?
n/a
The count pill: solid tone fill, contrast-picked label, capped "99+". tone defaults to AGENT; contentDescription defaults to the count text.
NockerlBadge(text, tone, variant) *
String, NockerlBadgeTone, NockerlBadgeVariant
n/a
The tonal label pill. variant: SOFT (the default, a hue @ 0.15 wash + full-hue label) or SOLID (tone fill + contrast ink).
NockerlBadgeDot(contentDescription, tone) *
String, NockerlBadgeTone
n/a
The bare 8dp disc for unseen-but-uncounted activity. Accessible name is required, non-empty; tone defaults to AGENT.
The published NockerlBadge ships the full set on the same NockerlBadgeTone ladder as
Compose: count pill, bare dot, and tonal label pill (soft / solid). It is a passive View;
anchor it with .overlay(alignment: .topTrailing).
Parameter
Type
Default
Description
NockerlBadge(count:tone:label:) *
Int, NockerlBadgeTone, String?
n/a
The count pill: solid tone fill, contrast-picked label, capped "99+". tone defaults to .agent; label defaults to the count text.
NockerlBadge(_:tone:variant:) *
String, NockerlBadgeTone, NockerlBadgeVariant
n/a
The tonal label pill. variant: .soft (the default, a hue @ 0.15 wash + full-hue label), .solid (tone fill + contrast ink), or .outline (a 1pt tone stroke on a transparent fill + full-hue label, the Button-outline grammar; the lightest form for dense rows. Swift-first: react/compose parity tracked).
NockerlBadge.dot(tone:label:) *
NockerlBadgeTone, String
n/a
The bare 8pt disc. Accessible label is required, non-empty; tone defaults to .agent.
The published Compose (com.dizyx.nockerl.design.components) and Swift
(NockerlDesign) packages now both ship a first-class NockerlBadge with the full set:
count pill, bare dot, and tonal label pill (soft / solid) on the same NockerlBadgeTone
ladder. The earlier coverage gap and “no shared wrapper” drift are resolved. What remains:
Default count hue(resolved): the unread-count badge hue
is danger-red; the orange agent-family token was a categorical misuse. The web demo already
defaults the inbox to danger-red; both native packages (today defaulting the count / dot to the
.agent / AGENT orange) conform.