# Adaptive Card sample: Badge

- id: `badge`
- Adaptive Card schema version: 1.5

Demonstrates the Badge element — shapes (Circular/Rounded/Square), sizes (Medium/Large/ExtraLarge), styles (Default/Informative/Accent/Good/Attention/Warning/Subtle), appearances (Filled/Tint), icons with position (Before/After), and tooltip.

## Elements

- `Badge` — shape: Circular / Rounded / Square
- `Badge` — size: Medium / Large / ExtraLarge
- `Badge` — style: Default / Informative / Accent / Good / Attention / Warning / Subtle
- `Badge` — appearance: Filled / Tint
- `Badge` — icon + iconPosition: Before / After
- `Badge` — tooltip
- `Layout.Flow` — horizontalItemsAlignment: Left, minItemWidth: 0px

## Card JSON

```json
{
  "type": "AdaptiveCard",
  "version": "1.5",
  "body": [
    {
      "type": "TextBlock",
      "text": "Shapes",
      "wrap": true
    },
    {
      "type": "Container",
      "layouts": [
        {
          "type": "Layout.Flow",
          "horizontalItemsAlignment": "Left",
          "minItemWidth": "0px"
        }
      ],
      "items": [
        {
          "type": "Badge",
          "text": "Circular",
          "size": "Large",
          "style": "Accent"
        },
        {
          "type": "Badge",
          "text": "Rounded",
          "size": "Large",
          "style": "Accent",
          "shape": "Rounded"
        },
        {
          "type": "Badge",
          "text": "Square",
          "size": "Large",
          "style": "Accent",
          "shape": "Square"
        }
      ]
    },
    {
      "type": "TextBlock",
      "text": "Sizes",
      "wrap": true,
      "separator": true,
      "spacing": "ExtraLarge"
    },
    {
      "type": "Container",
      "layouts": [
        {
          "type": "Layout.Flow",
          "horizontalItemsAlignment": "Left",
          "minItemWidth": "0px"
        }
      ],
      "items": [
        {
          "type": "Badge",
          "text": "Extra large no icon",
          "size": "ExtraLarge"
        },
        {
          "type": "Badge",
          "text": "Extra large with icon",
          "size": "ExtraLarge",
          "icon": "Calendar"
        },
        {
          "type": "Badge",
          "text": "Extra large with icon on right",
          "size": "ExtraLarge",
          "icon": "Calendar",
          "iconPosition": "After"
        },
        {
          "type": "Badge",
          "size": "ExtraLarge",
          "icon": "Calendar"
        }
      ]
    },
    {
      "type": "Container",
      "layouts": [
        {
          "type": "Layout.Flow",
          "horizontalItemsAlignment": "Left",
          "minItemWidth": "0px"
        }
      ],
      "items": [
        {
          "type": "Badge",
          "text": "Large no icon",
          "size": "Large"
        },
        {
          "type": "Badge",
          "text": "Large with icon",
          "size": "Large",
          "icon": "Calendar"
        },
        {
          "type": "Badge",
          "text": "Large with icon on right",
          "size": "Large",
          "icon": "Calendar",
          "iconPosition": "After"
        },
        {
          "type": "Badge",
          "size": "Large",
          "icon": "Calendar"
        }
      ],
      "spacing": "Large"
    },
    {
      "type": "Container",
      "layouts": [
        {
          "type": "Layout.Flow",
          "horizontalItemsAlignment": "Left",
          "minItemWidth": "0px"
        }
      ],
      "items": [
        {
          "type": "Badge",
          "text": "Medium no icon"
        },
        {
          "type": "Badge",
          "text": "Medium with icon",
          "icon": "Calendar"
        },
        {
          "type": "Badge",
          "text": "Medium with icon on right",
          "icon": "Calendar",
          "iconPosition": "After"
        },
        {
          "type": "Badge",
          "icon": "Calendar"
        }
      ],
      "spacing": "Large"
    },
    {
      "type": "TextBlock",
      "text": "Styles and colors",
      "wrap": true,
      "separator": true,
      "spacing": "ExtraLarge"
    },
    {
      "type": "Container",
      "layouts": [
        {
          "type": "Layout.Flow",
          "horizontalItemsAlignment": "Left",
          "minItemWidth": "0px"
        }
      ],
      "items": [
        {
          "type": "Badge",
          "text": "Default filled",
          "size": "Large"
        },
        {
          "type": "Badge",
          "text": "Default tint",
          "size": "Large",
          "appearance": "Tint"
        },
        {
          "type": "Badge",
          "text": "Informative filled",
          "size": "Large",
          "style": "Informative"
        },
        {
          "type": "Badge",
          "text": "Informative tint",
          "size": "Large",
          "appearance": "Tint",
          "style": "Informative"
        },
        {
          "type": "Badge",
          "text": "Accent filled",
          "size": "Large",
          "style": "Accent"
        },
        {
          "type": "Badge",
          "text": "Accent tint",
          "size": "Large",
          "appearance": "Tint",
          "style": "Accent"
        },
        {
          "type": "Badge",
          "text": "Good filled",
          "size": "Large",
          "style": "Good"
        },
        {
          "type": "Badge",
          "text": "Good tint",
          "size": "Large",
          "appearance": "Tint",
          "style": "Good"
        },
        {
          "type": "Badge",
          "text": "Attention filled",
          "size": "Large",
          "style": "Attention"
        },
        {
          "type": "Badge",
          "text": "Attention tint",
          "size": "Large",
          "appearance": "Tint",
          "style": "Attention"
        },
        {
          "type": "Badge",
          "text": "Warning filled",
          "size": "Large",
          "style": "Warning"
        },
        {
          "type": "Badge",
          "text": "Warning tint",
          "size": "Large",
          "appearance": "Tint",
          "style": "Warning"
        },
        {
          "type": "Badge",
          "text": "Subtle filled",
          "size": "Large",
          "style": "Subtle"
        },
        {
          "type": "Badge",
          "text": "Subtle tint",
          "size": "Large",
          "appearance": "Tint",
          "style": "Subtle"
        }
      ]
    },
    {
      "type": "TextBlock",
      "text": "With tooltip",
      "wrap": true,
      "separator": true,
      "spacing": "ExtraLarge"
    },
    {
      "type": "Container",
      "layouts": [
        {
          "type": "Layout.Flow",
          "horizontalItemsAlignment": "Left",
          "minItemWidth": "0px"
        }
      ],
      "items": [
        {
          "type": "Badge",
          "text": "With tooltip",
          "tooltip": "This is the tooltip",
          "size": "Large"
        },
        {
          "type": "Badge",
          "tooltip": "This is the tooltip",
          "size": "Large",
          "icon": "Calendar"
        }
      ]
    }
  ]
}
```
