AddThisFeature

Badge Component

Use one small label component instead of a dozen coloured pills.

simple Components & Primitives

What it adds

A compact label with fixed tone, shape, and size rules for counts, categories, and short attributes.

What your agent is told to do

5
  1. 1

    Collect the coloured pills, chips, tags, and counts already scattered across the app and reduce them to one component with a defined set of tones.

  2. 2

    Give each tone a stated meaning and use it consistently — a neutral tone for categories, and any semantic tone reserved for meaning rather than decoration.

  3. 3

    Constrain the content: a badge holds a short word, a very short phrase, or a number. Set an upper bound and decide what happens beyond it, including how a count above the bound is rendered.

  4. 4

    Keep badges non-interactive. If something needs to be clicked, dismissed, or filtered on, it is a chip or a button and belongs to the relevant control, not here.

  5. 5

    Where a badge is being used to show the state of a record, that meaning is owned by Status Indicator System; this brief owns only the visual container and its constraints. Do not define a status vocabulary here.

Edge cases it handles

7
  • Long or translated labels will overflow a badge sized for English. Set a maximum width with predictable truncation and keep the full value available on hover and in the accessible name.
  • Small text on a tinted background frequently fails contrast even when the same colours pass at body size. Verify each tone at the badge's actual text size in both light and dark themes.
  • A badge that carries an interaction — a remove cross, a click-to-filter — becomes a control and inherits every requirement of one, including focus, keyboard operation, and a hit area. Keeping labels and controls separate avoids that entirely.
  • In a dense table cell or a narrow card, a row of badges must wrap or collapse to a count rather than forcing the column wider or clipping at the edge.
  • Numeric badges need a defined ceiling, so a count of nine thousand does not stretch a navigation item.
  • A badge conveying meaning by colour alone is unreadable to colourblind users; the text inside it must carry the information.
  • Badges placed inside a link or button must not be announced as separate interactive elements.

Definition of done

8
  • One badge component covers every compact label in the app.
  • Each tone has a documented meaning and is used only for that meaning.
  • Badge text passes contrast at its actual size in every supported theme.
  • Overlong content truncates predictably with the full value still available.
  • Badges contain no interactive controls.
  • Badge groups in tables and cards wrap or collapse without widening or clipping their container.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.