{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "display",
  "status": "alpha",
  "import": "@senvenli/react/display",
  "name": "badge",
  "title": "Badge",
  "exports": [
    "Badge",
    "BadgeAnchor"
  ],
  "description": "A short label beside content: a record's status in a pill (subtle or bold), a live state as a dot and a word, or a count.",
  "keywords": [
    "status",
    "tag",
    "label",
    "pill",
    "chip",
    "state",
    "count",
    "counter",
    "notification",
    "unread",
    "dot",
    "live",
    "country",
    "language",
    "code",
    "iso"
  ],
  "usage": {
    "when": [
      "Showing the state of an item: draft, paid, overdue.",
      "Showing how many items need attention.",
      "Marking a country or language next to its name."
    ],
    "instead": [
      {
        "use": "tag-group",
        "when": "The labels can be removed or selected."
      },
      {
        "use": "avatar",
        "when": "The label is a person or a company."
      }
    ]
  },
  "guidance": [
    {
      "rule": "The word carries the meaning, never the color alone; use sentence case."
    },
    {
      "rule": "Use the bold appearance sparingly, for the one status that matters most."
    },
    {
      "rule": "Use `danger` only for counts that need action now."
    }
  ],
  "a11y": {
    "builtIn": [
      "Text meets WCAG AA in both appearances.",
      "Counts above `max` show as \"max+\".",
      "On an icon the badge is hidden; the control's label must say the count.",
      "Hidden from screen readers when the name is next to it."
    ],
    "youProvide": [
      "A status word that makes sense without color.",
      "The count in the control's accessible name when the badge sits on an icon.",
      "The name beside it."
    ]
  },
  "related": [
    "icon",
    "input"
  ],
  "genui": {
    "expose": true,
    "description": "A numeric count next to a label. Use lozenge for status words.",
    "props": [
      "value",
      "max",
      "tone"
    ],
    "children": "none",
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "The count; nothing renders at 0. Left out, an 8px unread marker without a number, hidden from screen readers, so\nthe text or label next to it says \"new\"."
        },
        "max": {
          "type": "number",
          "description": "Above it shows \"max+\"; default 99, or 9 on an icon."
        },
        "tone": {
          "type": "string",
          "enum": [
            "neutral",
            "danger",
            "information",
            "success",
            "warning",
            "brand",
            "inverse"
          ],
          "description": "One meaning per tone: information (Approved, In progress) · brand (Featured) · success\n(Completed, Available, Paid) · warning (Payment pending, Under review) · danger (Canceled,\nFailed, Overdue) · neutral (Draft, Inactive)."
        }
      }
    }
  },
  "source": [
    "src/display/badge.tsx"
  ],
  "props": {
    "Badge": [
      {
        "name": "tone",
        "type": "Tone | BadgeCountTone",
        "required": false,
        "origin": "own",
        "description": "One meaning per tone: information (Approved, In progress) · brand (Featured) · success\n(Completed, Available, Paid) · warning (Payment pending, Under review) · danger (Canceled,\nFailed, Overdue) · neutral (Draft, Inactive).",
        "schema": {
          "type": "string",
          "enum": [
            "neutral",
            "danger",
            "information",
            "success",
            "warning",
            "brand",
            "inverse"
          ]
        }
      },
      {
        "name": "variant",
        "type": "\"bold\" | \"dot\" | \"subtle\" | \"count\"",
        "required": false,
        "origin": "own",
        "description": "`subtle` (default): the status of a record in a pill. `bold`: the one status on the screen that needs attention\nnow. `dot`: a dot and the word, for a live system state (online, syncing).",
        "schema": {
          "type": "string",
          "enum": [
            "bold",
            "dot",
            "subtle",
            "count"
          ]
        }
      },
      {
        "name": "hasDot",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "description": "A 6px dot inside a pill (subtle or bold), for live states. `dot` always has its dot.",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "radius",
        "type": "ComponentRadius",
        "required": false,
        "origin": "own",
        "description": "Pills only (`subtle`, `bold`): corner radius, `none` to `full`; the design's small step (or the provider's default) otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "small",
            "medium",
            "large",
            "full"
          ]
        }
      },
      {
        "name": "isLive",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "description": "`dot` only: a 3px halo for a state that is active right now (connected, syncing).",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "The status word, sentence case (\"Payment pending\"); the word carries the meaning, never the colour."
      },
      {
        "name": "aria-label",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "`dot` only, where a visible word is impossible (a dense table cell with its own column header).",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "value",
        "type": "number",
        "required": false,
        "origin": "own",
        "description": "The count; nothing renders at 0. Left out, an 8px unread marker without a number, hidden from screen readers, so\nthe text or label next to it says \"new\".",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "max",
        "type": "number",
        "required": false,
        "origin": "own",
        "description": "Above it shows \"max+\"; default 99, or 9 on an icon.",
        "schema": {
          "type": "number"
        }
      }
    ],
    "BadgeAnchor": [
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own"
      }
    ]
  },
  "tokens": [
    "ds-background-brand-bold",
    "ds-background-brand-subtle",
    "ds-background-danger",
    "ds-background-danger-bold",
    "ds-background-information",
    "ds-background-information-bold",
    "ds-background-neutral",
    "ds-background-neutral-bold",
    "ds-background-success",
    "ds-background-success-bold",
    "ds-background-warning",
    "ds-background-warning-bold",
    "ds-easing-enter",
    "ds-icon-brand",
    "ds-icon-danger",
    "ds-icon-information",
    "ds-icon-subtle",
    "ds-icon-success",
    "ds-icon-warning",
    "ds-radius-control-small",
    "ds-radius-full",
    "ds-space-050",
    "ds-space-075",
    "ds-space-100",
    "ds-surface",
    "ds-text",
    "ds-text-brand",
    "ds-text-danger",
    "ds-text-information",
    "ds-text-inverse",
    "ds-text-on-bold",
    "ds-text-on-brand",
    "ds-text-on-danger",
    "ds-text-on-warning",
    "ds-text-subtle",
    "ds-text-success",
    "ds-text-warning"
  ],
  "strings": [],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
