← All proposals

Badge

An extension of the PDS Badge: one new prop, as ('span' | 'kbd', default 'span').

Extends a PDS componentOpen in Storybook

proposals/Badge/decisions.md30 lines · View on GitHub

Decisions: Badge

Reopened as a one-prop extension (2026-11-20)

  • Decision: the Badge is a proposal again, with a local copy of the beta.21 package Badge (isWrappable included) and one addition, as?: 'span' | 'kbd'. The earlier agentic-filled proposal stays dropped (_implemented/Badge/).
  • Why: Global search needs a keyboard-key hint. A <kbd> nested in the Badge label works, but the key is then a span around a kbd; the badge itself should be the key.
  • Port impact: add as to the package Badge and the kbd.pds-badge font rule. Global search imports the local Badge until then.

as is span or kbd only

  • Decision: two values, not any element.
  • Why: no other element has a use; a knob with one right value goes unused (L11).
  • Port impact: none.

A kbd badge resets the font

  • Decision: kbd.pds-badge { font-family: inherit }, no new class.
  • Why: the browser's kbd default is monospace; the Badge uses the page font.
  • Port impact: the rule goes in badge.css.

Local CSS holds only the addition

  • Decision: badge.css has the one rule above, not a copy of the package CSS.
  • Why: the package CSS is loaded alongside and already styles every color and size; a full copy would only drift.
  • Port impact: none.

Open questions

  • A real keyboard-key component in PDS: the PDS team.