# <tag>

Defines a tag of your own from built-in markup; every attribute but name is a prop with a default.

Category: Data.

```ham
<tag name="price-tag"
     label="Item">
    <attr name="price"
          type="text"
          default="0.00"/>
    <row style="w-full p-12 rounded-lg border border-gray-300 dark:border-gray-700 justify-between">
        <text @text="$label"></text>
        <text @text="'$' + $price"
              style="font-bold"></text>
    </row>
</tag>

<column style="w-full gap-8">
    <price-tag label="Croissant"
               price="3.20"/>
    <price-tag label="Flat white"
               price="4.50"/>
</column>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `attrs` | The older spelling of the props: "count=0, color=amber, label" (name=default); the same as writing each as an attribute of <tag>. |  |
| `name` | The tag's name: lowercase, a letter first, at least one hyphen (rating-stars). |  |

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

- [Your own tags](https://hypeapps.dev/docs/guides/own-tags.md)

## Related tags

- [`<attr>`](https://hypeapps.dev/docs/reference/attr.md): Declares one prop of a tag of your own in full: its name, type and default value.
- [`<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.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<slot>`](https://hypeapps.dev/docs/reference/slot.md): Marks where an instance's children go inside a user-defined tag; its own content is the fallback.

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