# <badge>

A small count or dot pinned to the corner of an icon or any other element.

Category: Display.

```ham
<row style="gap-32 items-center">
    <badge count="3">
        <icon name="mail size-28"/>
    </badge>
    <badge count="12"
           color="teal">
        <icon name="shopping_cart size-28"/>
    </badge>
    <badge>
        <icon name="notifications size-28"/>
    </badge>
</row>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/badge-light.webp), [dark](https://hypeapps.dev/img/tags/badge-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `color` | Badge background color | `red` |
| `count` | Badge label/count text. A count of 0 hides the badge unless show-zero. |  |
| `show-zero` | Keep the badge (showing 0) when the count is 0. | `false` |
| `size` | Badge size | `18` |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Related tags

- [`<row>`](https://hypeapps.dev/docs/reference/row.md): Lays children side by side in one line; flex= shares the free space and align/cross position them.
- [`<icon>`](https://hypeapps.dev/docs/reference/icon.md): A Material Symbols icon, with its style, weight, size and color set in its name.
- [`<ad>`](https://hypeapps.dev/docs/reference/ad.md): An ad slot in the page, filled with a banner from AdMob in a built app.
- [`<avatar>`](https://hypeapps.dev/docs/reference/avatar.md): A round avatar from a photo, initials or an icon, in any size and color.
- [`<canvas-tool>`](https://hypeapps.dev/docs/reference/canvas-tool.md): A drawing tool written in HAM and loaded into a draw pad as a plugin: touch handlers, state and options.
- [`<caption>`](https://hypeapps.dev/docs/reference/caption.md): A table caption, shown as a label above the table.
- [`<carousel>`](https://hypeapps.dev/docs/reference/carousel.md): Swipeable pages side by side, one at a time, with dots below that show which page is on screen.
- [`<chart>`](https://hypeapps.dev/docs/reference/chart.md): A line, area, bar or sparkline chart drawn from a list of values; a tap shows a point's value.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
