# <path>

A vector shape from points or SVG-like path data, stroked, filled or dashed.

Category: Display.

```ham
<column style="gap-16 w-full items-center">
    <path d="M 0 40 Q 50 0 100 40 Q 150 80 200 40"
          stroke="#13B3A6"
          stroke-width="3"
          style="w-200 h-60"/>
    <path points="10,90 50,10 90,90"
          closed="true"
          fill="#F59E0B"
          style="w-100 h-100"/>
    <path d="M 0 20 L 200 20"
          stroke="#6366F1"
          stroke-width="2"
          dash="6 4"
          style="w-200 h-40"/>
</column>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `cap` | The line cap. (round, butt, square) | `round` |
| `closed` | Join the last point to the first. | `false` |
| `d` | An SVG path: M L H V C S Q T A Z, absolute or relative (a command cut short ends the path there). Takes precedence over points. |  |
| `dash` | Dashes: "on off" lengths ("6 4"), or one number for equal dashes. |  |
| `fill` | The fill color (none by default). (none) |  |
| `in` | A <canvas>'s id (#pad): the path overlays that pad in document coordinates and follows its view. |  |
| `join` | The line join. (round, miter, bevel) | `round` |
| `opacity` | The shape's opacity, 0–1. | `1` |
| `points` | The vertices, "x,y x,y …", a polyline (closed="true" joins the ends). |  |
| `stroke` | The outline color (black when there is no fill; none for no outline). (none) |  |
| `stroke-width` | The outline width (on screen, for an overlay). | `1` |
| `viewbox` | On its own: "x y w h", the coordinate space scaled to fit the box, as SVG's viewBox. |  |

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.
- [`<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.
- [`<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
