# <pixels>

A grid of on/off cells painted in one go: pixel art, or a frame of an animation held in a variable.

Category: Media.

```ham
<column style="gap-8 w-full items-center">
    <block style="w-160">
        <pixels data="00100100/00111100/01011010/01111110/00111100/00100100/01000010/00000000"
                color="teal-600"
                style="w-full"/>
    </block>
    <text style="muted">Space invader, 8 × 8</text>
</column>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `background` (also `bg`) | Off cells (default: none). |  |
| `color` | On cells (default: the text color). |  |
| `cols` | Cells per row (default: the longest row). |  |
| `data` | The rows of 1/0 (or #/.) joined by / or line breaks. |  |

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

- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<block>`](https://hypeapps.dev/docs/reference/block.md): The general-purpose container: groups children and gives them padding, color, corners and a border.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<audio>`](https://hypeapps.dev/docs/reference/audio.md): A compact audio player bar with play, a progress track and the track's title and artist.
- [`<camera>`](https://hypeapps.dev/docs/reference/camera.md): A live camera viewfinder with a shutter; the photo's path goes into a variable.
- [`<canvas>`](https://hypeapps.dev/docs/reference/canvas.md): A drawing surface for finger or stylus, with a pen, eraser and color toolbar; it saves as a PNG.
- [`<file-picker>`](https://hypeapps.dev/docs/reference/file-picker.md): Opens the device's photo, video or file picker (or the camera) and puts the chosen file in a variable.
- [`<img>`](https://hypeapps.dev/docs/reference/img.md): Shows a picture from a URL or the app's files, sized and cropped by its style.

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