Skip to main content
A badge component for displaying status or labels.
{
  "type": "object",
  "properties": {
    "type": {
      "const": "Badge",
      "default": "Badge",
      "type": "string"
    },
    "id": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "HTML id attribute for CSS targeting. Applied to the outermost element."
    },
    "cssClass": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "CSS/Tailwind classes for styling. Accepts a Responsive() for breakpoint-aware classes."
    },
    "children": {
      "type": "array",
      "items": {
        "$ref": "Component"
      }
    },
    "let": {
      "additionalProperties": true,
      "type": [
        "object",
        "null"
      ],
      "default": null,
      "description": "Scoped bindings available to children. Values are template strings."
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Badge text"
    },
    "variant": {
      "anyOf": [
        {
          "enum": [
            "default",
            "secondary",
            "destructive",
            "success",
            "warning",
            "info",
            "outline",
            "ghost"
          ],
          "type": "string"
        },
        {
          "type": "string"
        }
      ],
      "default": "default",
      "description": "Visual variant: default, secondary, destructive, outline, ghost, success, warning, or info"
    }
  },
  "required": [
    "type"
  ]
}