# <chip>

A compact chip: a label, a filter that toggles, a single choice in a set, or an action.

Category: Forms and input.

```ham
<inline-content spacing="8 8">
    <chip variant="choice"
          label="Small"/>
    <chip variant="choice"
          label="Medium"
          selected="true"/>
    <chip variant="choice"
          label="Large"/>
    <chip variant="action"
          label="Add note"
          icon="add"/>
</inline-content>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `color` | Color |  |
| `icon` | Icon name |  |
| `label` | Chip text |  |
| `name` | Choice chips sharing a name are one choice (default: the choice chips side by side) |  |
| `selected` | Initially selected (filter/choice variants) | `false` |
| `variant` | Chip style variant (filled, outlined, filter, choice, action) | `filled` |

## Readings

| Name | What it does |
|---|---|
| `selected` | Whether the chip is selected (filter and choice chips). |

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

- [Lists and loops](https://hypeapps.dev/docs/guides/lists.md)
- [Who's using the app ($me)](https://hypeapps.dev/docs/guides/me.md)

## Related tags

- [`<inline-content>`](https://hypeapps.dev/docs/reference/inline-content.md): Lays its children out in a row that wraps onto new lines, with set gaps between them.
- [`<button>`](https://hypeapps.dev/docs/reference/button.md): A tappable button that runs an action: a fetch, a navigation or a statement.
- [`<checkbox>`](https://hypeapps.dev/docs/reference/checkbox.md): A checkbox with a label; its state goes into a variable by name.
- [`<color-picker>`](https://hypeapps.dev/docs/reference/color-picker.md): A color picker: a hue ring round a disc, with swatches; the chosen color goes into a variable.
- [`<data-cell>`](https://hypeapps.dev/docs/reference/data-cell.md): One cell of a data table row.
- [`<data-column>`](https://hypeapps.dev/docs/reference/data-column.md): A column heading of a data table.
- [`<data-row>`](https://hypeapps.dev/docs/reference/data-row.md): One row of a data table, holding a data cell for each column.
- [`<data-table>`](https://hypeapps.dev/docs/reference/data-table.md): A table of rows and columns with a header; the HTML table tags write the same table.

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