# <countdown>

A timer that counts down to zero in a format you choose and can act when it gets there.

Category: Display. Also written `<timer>`.

```ham
<column style="items-center gap-8">
    <text style="muted">Next question in</text>
    <countdown seconds="90"
               format="mm:ss"/>
</column>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `format` | Display format (hh:mm:ss, mm:ss, ss) | `mm:ss` |
| `seconds` | Total seconds to count down | `60` |

## Events

| Name | What it does |
|---|---|
| `on-done` | Statements run once when it reaches 0 (same as action-done / @on.done). Not while hidden by @show: hidden, it waits at its full time and starts over when shown; removed before 0, it never fires; mounted again (@@show, a new key), it counts from the top. |

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.

## Guides and recipes that use it

- [Animations and effects](https://hypeapps.dev/docs/guides/animations.md)

## Related tags

- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<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.
- [`<badge>`](https://hypeapps.dev/docs/reference/badge.md): A small count or dot pinned to the corner of an icon or any other element.
- [`<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.

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