# Cards

A page is a list of cards, shown in the order you give them. There are twenty-nine types. Shared fields and links has a table of what each one is for; the other four pages give each type's fields and show it drawn.

- [Shared fields and links](https://legatobar.com/docs/card-fields.md): What every card accepts, how wide each type is, the table of all twenty-nine types, and how a card links to a website or another page.
- [Numbers](https://legatobar.com/docs/card-numbers.md): stat, pacing, sparkline, gauge, bars, breakdown, flow, ranges, columns and tiles.
- [Lists and rows](https://legatobar.com/docs/card-lists.md): list, table, status, map, facts, fleet and checklist.
- [Time](https://legatobar.com/docs/card-time.md): countdown, window, agenda, month, timeline, strip and heatmap.
- [Text and layout](https://legatobar.com/docs/card-text.md): text, link and code, with heading and tabs, which arrange the cards around them.


---

# Shared fields and links

A page's `cards` array sets the order from top to bottom. There are twenty-nine card types; [Features](https://legatobar.com/features) shows each one alongside its example JSON.

`stat`, `status` (unless `"width": "full"`), `countdown` and `gauge` cards are half width, as are a `pacing` ring, a `link` tile and a `sparkline` with `"width": "half"`. Two consecutive half-width cards share a row. Everything else takes the full width.

| Type | For |
| --- | --- |
| [`stat`](https://legatobar.com/docs/card-numbers.md#stat) | One headline number: a balance, open PRs, uptime |
| [`pacing`](https://legatobar.com/docs/card-numbers.md#pacing) | Progress against a target: budget pace, a sprint, a ring for today's steps |
| [`list`](https://legatobar.com/docs/card-lists.md#list) | Up to 60 short lines: largest charges, new deals |
| [`table`](https://legatobar.com/docs/card-lists.md#table) | A small grid, up to 4 columns and 10 rows |
| [`sparkline`](https://legatobar.com/docs/card-numbers.md#sparkline) | A trend line of up to 240 points |
| [`status`](https://legatobar.com/docs/card-lists.md#status) | The health of one service or job |
| [`text`](https://legatobar.com/docs/card-text.md#text) | A short note, up to 500 characters |
| [`link`](https://legatobar.com/docs/card-text.md#link) | A button that opens an https URL or another page |
| [`countdown`](https://legatobar.com/docs/card-time.md#countdown) | Time until a moment: a flight boards, a domain renews |
| [`window`](https://legatobar.com/docs/card-time.md#window) | A window in the day: daylight left, opening hours, off-peak charging |
| [`map`](https://legatobar.com/docs/card-lists.md#map) | Places on Apple's map: the car, a package, a trip's stops |
| [`facts`](https://legatobar.com/docs/card-lists.md#facts) | A few labelled values: order number, carrier, ETA |
| [`gauge`](https://legatobar.com/docs/card-numbers.md#gauge) | A value in a range with coloured bands: CPU temperature, air quality |
| [`bars`](https://legatobar.com/docs/card-numbers.md#bars) | Categories with values: spend by category, votes |
| [`breakdown`](https://legatobar.com/docs/card-numbers.md#breakdown) | Parts of one whole in one coloured bar: net worth by asset, a budget by category |
| [`flow`](https://legatobar.com/docs/card-numbers.md#flow) | Where amounts go: DNS queries from each device to allowed and blocked, solar and grid to the house and the car |
| [`ranges`](https://legatobar.com/docs/card-numbers.md#ranges) | Rows from low to high on one scale: a week of temperatures, a price's daily range |
| [`columns`](https://legatobar.com/docs/card-numbers.md#columns) | Periods side by side, one to three series: income against spending by month |
| [`tiles`](https://legatobar.com/docs/card-numbers.md#tiles) | Small tiles four across, each a label, a value and a change, tinted by how far it moved: a watchlist |
| [`fleet`](https://legatobar.com/docs/card-lists.md#fleet) | A dot per host or job, up to 60 |
| [`checklist`](https://legatobar.com/docs/card-lists.md#checklist) | Up to 20 items, done or not |
| [`agenda`](https://legatobar.com/docs/card-time.md#agenda) | A day, a week or up to 30 days of meetings, trips, deadlines and bills, with a line at now |
| [`month`](https://legatobar.com/docs/card-time.md#month) | This month as a grid with a dot on each busy day, and the chosen day's items |
| [`timeline`](https://legatobar.com/docs/card-time.md#timeline) | A dated history newest first: a package's tracking, a job's runs, an order's steps |
| [`strip`](https://legatobar.com/docs/card-time.md#strip) | An item's states over a span, a thin bar per slice: a monitor's last day |
| [`heatmap`](https://legatobar.com/docs/card-time.md#heatmap) | A square per day in week columns, shaded by how much: a year of contributions or steps |
| [`code`](https://legatobar.com/docs/card-text.md#code) | A block of code or a command, monospaced, with a Copy button |
| [`heading`](https://legatobar.com/docs/card-text.md#heading) | A section title that splits a long page into parts, which can open and close |
| [`tabs`](https://legatobar.com/docs/card-text.md#tabs) | Two to five tabs in one place, each with its own cards: several feeds, today and this week, one server each |

The [page schema](https://legatobar.com/docs/page-writing.md#the-schema) has every card type with its fields and limits, as JSON Schema (draft-07): in your Pages folder at `.schemas/page.schema.json`, at [legatobar.com/schemas/page.schema.json](https://legatobar.com/schemas/page.schema.json), and from `get_page_schema` or `legato schema <type>`, one type at a time. If this page and the schema ever disagree, the schema is right.

## Fields every card has

| Field | | |
| --- | --- | --- |
| `id` | required | Unique within the page. 1–64 characters: lowercase letters, digits, `-` and `_`, starting with a letter or digit. Keep ids stable between writes. |
| `type` | required | One of the twenty-nine types. |

Each type accepts only the fields listed for it, and the schema flags a misspelled field (`"lable"`) in your editor. Legato itself refuses a card that's missing a required field or has the wrong kind of value, saying which (`a stat card needs label`), and ignores a field it doesn't know, so check new pages against the schema. Wherever a card has a `label`, it's 1–60 characters; a `unit` is 1–16.

A three-letter currency code as `unit` (`USD`, `EUR`, `GBP`, …) formats numbers as money in the Mac's locale, with cents only when the number has them: `4218.55` with `USD` shows as `$4,218.55`, and `1060` as `$1,060`. Any other unit is shown as is after the number.

## Links to other pages

Wherever a card takes a link (a `list` row, a `facts` line, a `bars` row, a `link` card, a `fleet` item, a `tiles` tile, an `agenda` or `month` item, or a Markdown link in text), it can be another of your pages instead of a web address: `legato://page/ID`, where ID is the page's id as `legato list` and `list_pages` show it, the file's name without `.json`, matched exactly (case included), with a space written `%20` (`legato://page/My%20Page`). Nothing else goes in the address: no other `%` escapes and no port. A query is for one thing, a page's [params](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item) (`legato://page/proxmox-vm?vmid=109`), and a `#` part for another, a card (below). A click shows that page in the panel, as choosing it in the sidebar does, and **Back** returns. The arrow is → rather than ↗, and the tooltip names the page ("Show the Pi-hole page"). A link to a page that doesn't exist (removed, or not made yet) isn't drawn as a link: a row or item shows its words, and a `link` card shows its label with "Page unavailable". The welcome pages work too: `legato://page/getting-started`. A page meant only to be reached this way can stay out of the sidebar: see [Detail pages](https://legatobar.com/docs/detail-pages.md#detail-pages).

### Links to a card

Add `#` and a card's id to bring that card into view: `legato://page/net-worth#cards`. Legato shows the page, chooses the tab that holds the card if it's in a [tabs](https://legatobar.com/docs/card-text.md#tabs) card, opens its section if a closed [heading](https://legatobar.com/docs/card-text.md#heading) holds it, and scrolls to it, unless it's already in full view. On the page the link is on, nothing else changes: a Liabilities total can open the Liabilities tab below it, with no new step for **Back**. A link to a heading opens its section, and a link to a tabs card scrolls to its tab names. A card id that isn't on the page, such as a card hidden by its `when`, opens the page as it is. Card ids are written as they are on the page: lowercase letters, digits, `_` and `-`.

```json
{ "id": "liabilities", "type": "stat", "label": "Liabilities", "value": 55558, "unit": "USD", "url": "legato://page/net-worth#cards" }
```

The same address works outside Legato: in a note, a Raycast quicklink, Shortcuts' **Open URLs**, or `open legato://page/budget` in Terminal opens the panel on that page (your browser asks first). An address for a page that doesn't exist opens the panel where it was.

```json
{ "id": "services", "type": "fleet", "label": "Services", "items": [
  { "name": "Pi-hole", "state": "ok", "url": "legato://page/pihole" },
  { "name": "Gitea", "state": "ok", "url": "https://gitea.example.com" } ] }
```

## Cards that link

For help choosing the structure, see [Page design](https://legatobar.com/docs/design.md#choose-the-right-structure), including a [linked overview and detail example](https://legatobar.com/docs/design.md#a-linked-overview-and-detail-example).

A `stat`, `status`, `breakdown` or `pacing` card with a `url` opens it when clicked. Without buttons, the whole card is the link: under the pointer (or with keyboard focus) it lights a little and shows its arrow, → for a page and ↗ for a web address, and its tooltip says where it goes. With buttons, a click on the card is never a press: the link is its own small button at the end of the row, named for the page or the site. Together with a [condition](https://legatobar.com/docs/mapping-conditions.md#cards-that-show-on-a-condition), a card can appear only when something needs attention and lead straight to the page about it.

## Item icons

Items on `bars`, `pacing` (rows), `breakdown`, `facts`, `checklist`, `list`, `agenda`, `month` and `timeline` cards can carry an `icon`, drawn at the start of the row, before the label and never inside a bar. When any item on a card has one, every row keeps its space, so the labels line up.

A symbol is grey, as the row's other supporting marks are. On `facts`, `bars`, `list`, `pacing` rows and `ranges`, an item can also name a `color` for its icon, by the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown) names: `blue`, `teal`, `orange`, `purple`, `green`, `pink`, `yellow`, `red`, `rose` or `grey`. Use it when the colour means something, such as a category's colour on other pages; leave it out otherwise. A breakdown's icons always take their part's colour. See [Card style](https://legatobar.com/docs/design.md#card-style).

```json
{ "key": "Resting", "value": "61 bpm", "icon": "heart", "color": "pink" }
```

| `icon` | Draws |
| --- | --- |
| `creditcard`, `cart`, `fork.knife` | That SF Symbol, in grey. |
| `si:chase`, `si:paypal` | A logo from [Simple Icons](https://simpleicons.org), in the text's colour. |
| `di:paypal`, `di:nocodb` | An icon from [Dashboard Icons](https://dashboardicons.com): in the text's colour by default, or in its own colours with **Show logos in one colour** off. |
| `mdi:cash`, `mdi:airplane` | An icon from [Material Design Icons](https://pictogrammers.com/library/mdi/), in the text's colour. |
| `site:citi.com` | The website's own icon: the sharpest of its Apple touch icon, the icons its homepage names and `/favicon.ico`. By default it's drawn like the one-colour sets, in the text's colour with its background taken out, so logos from different sites look like one set. With **Show logos in one colour** off, it keeps its brand colours, as a glass tile. |

`si:`, `di:` and `mdi:` are the names [Glance](https://github.com/glanceapp/glance) uses, so icons from a Glance config carry over.

The Mac downloads each web icon once, from jsDelivr or the named site only, keeps it, and asks again after 30 days; one that fails is tried again the next day, and its row stays blank meanwhile.

**Settings → General → Load icons from the web** turns downloads off; rows then show only SF Symbols. **Show logos in one colour**, beside it, is how each Mac chooses between one-colour logos (the default) and brand colours. Anything else in `icon` draws nothing.

A card filled from a [source](https://legatobar.com/docs/mapping.md#mapping) can choose an icon per row from the answer with `values`, such as a bank's icon from its name:

```json
"icon": { "path": "institution_name", "values": { "Chase": "site:chase.com", "Citibank Online": "site:citi.com" }, "default": "creditcard" }
```

`si:` logos are drawn from vectors, so where Simple Icons has a brand it's the crisper choice; `site:` covers the rest.



---

# Numbers

## stat

[See examples](https://legatobar.com/features#card-stat)

A single headline number.

| Field | | |
| --- | --- | --- |
| `label` | required | What the number is. |
| `value` | required | A number, or a string of up to 32 characters (`"99.98%"`, `"3 of 5"`). |
| `unit` | optional | A currency code, or a unit shown after the value (`Mbps`). |
| `delta` | optional | The change: a number (shown with a sign and an up or down arrow, and as money when `unit` is a currency), or a string of up to 16 characters (`"14 days to go"`). |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more, or an https address. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |

```json
{ "id": "balance", "type": "stat", "label": "Checking", "value": 4218.55, "unit": "USD", "delta": 312.4 }
```

## pacing

[See examples](https://legatobar.com/features#card-pacing)

Progress against a target: a budget over the month, a sprint, steps toward today's goal. Or rows, each against its own target: a budget per category.

| Field | | |
| --- | --- | --- |
| `label` | required | |
| `value` | required, unless there are `items` | Where you are now, a number. |
| `target` | required, unless there are `items` | The goal, a number above 0. |
| `elapsed` | optional | The fraction of the period gone, from 0 to 1. Halfway through the month is `0.5`. Leave it out for a goal with no period, like steps today. On a page without a [period](https://legatobar.com/docs/periods.md), `{ "month_elapsed": true }` in the map gives how far through this month today is. |
| `unit` | optional | |
| `detail` | optional | A second line under the card, up to 120 characters: `"no mindful minutes yet"`. |
| `shape` | optional | `bar` (the default), `ring`, or `rings` with 1 to 3 `items`: see [Rings](https://legatobar.com/docs/card-numbers.md#rings). |
| `amounts` | optional | `left` for a budget's words: each bar row says what's left (`$288 left`) or how far over (`$36 over`), and the pace line says `$521 under pace` or `over pace`. The card's own total keeps `$5,161 of $7,103`. Rings keep their figures. `value` draws the card's value as one large figure under its name (`65%`), with `note` beside it, for a level whose target is its full scale, such as a battery out of 100%. Default `spent`. |
| `note` | optional | With `amounts: value`, a few words beside the large figure, such as a battery's range (`213 mi`). |
| `color` | optional | The bar's colour, by a [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s names, where the colour means something: a battery's charge in `green`. Without it, the theme's chart colour. |
| `hide_caption` | optional | `true` leaves out the pace line under the bar or ring, which shows only with `elapsed`, like "$380 ahead of pace". Default `false`. |
| `items` | optional | Up to 20 rows of `{ "label", "value", "target", "icon", "key", "unit" }`: a label of 1–40 characters, a number, a target above 0, and optionally an [item icon](https://legatobar.com/docs/card-fields.md#item-icons), a `key` for its `details`, and a `unit` of its own when it isn't the card's. A row can also have a `subtitle`, `state`, `detail`, `url` and `image`: see [Rows with more](https://legatobar.com/docs/card-numbers.md#rows-with-more). |
| `image_shape` | optional | `poster` (the default), `square` or `wide`: the rows' [thumbnails](https://legatobar.com/docs/card-numbers.md#images-on-rows), unless a row sets its own. |
| `details` | optional | Up to 500 lines of `{ "key", "text", "detail", "url" }` that rows show when clicked open: the key of their row, a text of 1–80 characters, and optionally a right-aligned detail of up to 40, its `detail_color` (a refund in `green`, by the [breakdown card's names](https://legatobar.com/docs/card-numbers.md#breakdown)), an `aside` of up to 24 in a grey column (a date; `details_aside_at` puts it at the `start` or `end`, and once a line has one, dates and amounts each keep one width) and an https or `legato://page/ID` link to the individual record. |
| `fit` | optional | Keeps the page within the sidebar's length. The card shows as many rows as fit, at least 5, with **Show *N* more** only when some are left out. An opened row shows as many of its lines as fit, at least 3, with **Show all** only when some are left out, and the row opened last gives way first. Without the sidebar, every row shows and an opened row shows 20 lines. |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more, such as an exercise ring leading to past days and workouts, or an https address. A card with `items` isn't a link, since a click on a row opens its details, unless its shape is `rings`. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |

A bar takes the full width: "$2,140 of $3,200" and a bar filled to `value / target`. With `elapsed`, a tick marks where you'd be if exactly on pace, and a line under the bar says the pace: "$380 ahead of pace", "6 min behind pace", or "On pace" within 3% of the target. Nothing is coloured for being ahead or over: the tick, a full bar and the figures say it. Pacing never changes the page's status dot either, since ahead is bad for a budget and good for a sprint. Without `elapsed` there's no tick and no line: the figures and the bar already say how far there is to go.

With `items`, each row is the label, "$412 of $600" (the amount in the row's colour, "of $600" in grey) and its own bar. With `elapsed` every row has the pace tick. Leave `value` and `target` out to show only the rows, or set them for an overall bar above them. A card with rows is drawn as bars, whatever its `shape`.

Sourced rows can carry up to three places for buttons at their end, such as Message and Stop on a stream: see [Buttons on each row](https://legatobar.com/docs/button-rows.md#buttons-on-each-row).

A row with a `key` that `details` lines share gets a disclosure chevron: clicking it shows that row's first 20 lines under it, in the order given, with **Show all** for the remaining supplied lines and **Show fewer** to return to the preview. Clicking the row again hides its lines. A detail line with `url` opens its record separately from the row disclosure. This only reveals lines the page supplied; it does not fetch further records. Keys can be text or numbers, and `12` matches `"12"`, so a source can map a category's id straight in. A line without a key, such as an uncategorized transaction's, is skipped, and the rest of the card still shows. On a budget, that's each category's transactions this month:

```json
"details": [ { "key": 3411218, "text": "Costco", "detail": "$212 · Oct 14" }, { "key": 3411218, "text": "Trader Joe's", "detail": "$86 · Oct 21" } ]
```

```json
{ "id": "budgets", "type": "pacing", "label": "Budgets this month", "unit": "USD",
  "items": [ { "label": "Groceries", "value": 412, "target": 600 }, { "label": "Restaurants", "value": 260, "target": 200 } ] }
```

### Rows with more

A row can say more than its label and figures, as a stream does while it plays: what's on, who's watching, where. Each part is optional.

| Field | | |
| --- | --- | --- |
| `subtitle` | optional | Up to 80 characters, in grey after the label on the title line: `"S2 · E5 · The Long Tide"`. When the line runs short, the subtitle is cut first, then the label. |
| `state` | optional | Up to 16 characters, a grey word at the right of the title line: `"Paused"`. It's words only: it never colours the row or counts as a problem. |
| `detail` | optional | Up to 80 characters, a grey line under the bar: `"riley · Living room TV · Direct play"`. Once any row has one, every row draws the line, and its figure ("31 of 47 min") moves to the line's end, so the rows keep one height. |
| `url` | optional | Makes the row a link, as a [list](https://legatobar.com/docs/card-lists.md#list) row is: https, [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages), or plain http on the card's source's own address, so a server on your network links. A row with `details` lines opens them instead, and Preview Source says its `url` isn't used. |
| `image` | optional | A thumbnail before the row, as tall as its words. See [Images on rows](https://legatobar.com/docs/card-numbers.md#images-on-rows). |
| `image_shape` | optional | The row's own shape, overriding the card's. |

Rows without these parts draw exactly as before. A row's text is cut by the line, never in the data: VoiceOver reads all of it. With a source, map the rows with `each`, and give `source.empty` for an answer with none:

```json
{ "id": "now", "type": "pacing", "label": "Now playing", "unit": "min", "items": [],
  "source": { "ref": "media", "empty": { "when": { "path": "streams[0]", "exists": false }, "text": "Nothing playing" },
    "map": { "items": { "each": "streams", "fields": { "key": "id", "label": "title", "subtitle": "episode", "state": "state",
      "detail": "where", "value": "minutes", "target": "length", "image": { "template": "/Items/{item_id|raw}/Images/Primary?fillHeight=96" } } } } } }
```

### Images on rows

`pacing` rows and `list` items take an `image`: a poster, an album's cover or a still, drawn in the icon's place. They keep their own colours: they're media, the one exception to [logos in one colour](https://legatobar.com/docs/card-fields.md#item-icons).

- **From the card's source only.** `image` is a path on the source's own address (`/Items/9f…/Images/Primary`), or a full http(s) address on that same scheme, host and port. Anything else is refused: the row draws its placeholder, and Preview Source says why. A card whose source isn't read over http can't have images, and its page doesn't load.
- **Signed in as the source is.** Each image is fetched with the source's own sign-in, through the same connection settings, only while the panel shows the card, at most four at once and 2 MB each. Only PNG, JPEG, WebP, HEIC and GIF (its first frame) are drawn.
- **Kept on this Mac.** Images are kept in Legato's cache folder, about 50 MB at most, the least recently shown going first, and used for a week before they're fetched again. A failed image never shows a note or fails the card: its row keeps the placeholder and it's tried again ten minutes later.
- **Nothing moves.** A neutral placeholder of the same size shows while an image loads or when it can't, with the row's `icon` in it, or a picture mark once an image can't be had. A row whose `image` is empty (`""`) asks for nothing and shows the placeholder: map it that way when the service says an item has no artwork (Jellyfin's image tags), so no request goes for a picture that isn't there. Once any row has an image, every row keeps the thumbnail's room, so the words line up. VoiceOver skips the thumbnails, since the row's words already say what it is.

**Settings → General → Load icons from the web** doesn't apply to these images: they come from the service the card is connected to, never from anywhere else.

| `image_shape` | Shape |
| --- | --- |
| `poster` (the default) | 2:3, a film's or a show's |
| `square` | 1:1, an album's |
| `wide` | 16:9, a still |

On a pacing row the thumbnail is as tall as the row's words; on a list row it's one line and a little. A row's own `image_shape` overrides its card's, so a song's square cover can sit among posters.

A ring is half width, like a fitness ring: filled to `value / target`, with the value beside it and the target under that. It shares its row with the next card if that one is half width too.

```json
{ "id": "month", "type": "pacing", "label": "October spend", "value": 2140, "target": 3200, "elapsed": 0.55, "unit": "USD" }
```

```json
{ "id": "steps", "type": "pacing", "shape": "ring", "label": "Steps", "value": 83, "target": 8000, "unit": "steps", "detail": "no mindful minutes yet" }
```

### Rings

With `"shape": "rings"`, 1 to 3 `items` are nested rings, the first outermost, the way a watch shows Move, Exercise and Stand. The card is half width. Beside the rings, each item's value and target ("310/500 kcal") are in its ring's colour. The items' labels aren't drawn, since the units tell the rings apart, but VoiceOver reads them. Give each item its own `unit`. A ring past its target is drawn full; rings have no pace tick or caption. Name a `color` on an item to choose its ring's colour; without one, rings take pink, green and teal in turn. Get Card Value reads the first ring.

```json
{ "id": "activity", "type": "pacing", "shape": "rings", "label": "Activity", "url": "legato://page/exercise",
  "items": [ { "label": "Move", "value": 310, "target": 500, "unit": "kcal" },
            { "label": "Exercise", "value": 12, "target": 30, "unit": "min" },
            { "label": "Stand", "value": 4, "target": 12, "unit": "h" } ] }
```

Add `days` and the card is a full-width calendar instead, with small rings for each day under the title. Each day has a `date` (`YYYY-MM-DD`) and `values`, one for each item in the items' order (`null` for a day with no figure). The items still give each ring's target, unit and colour. Days without an entry draw empty rings, and today is outlined. An empty `days` array keeps the card full width and says "No figures for this period." Each day’s readings, goals and missing figures are available to VoiceOver and on hover.

| Field | | |
| --- | --- | --- |
| `days` | optional | Up to 42 of `{ "date", "values" }`, with no more values than items. Without `calendar`, the first and last dates must fit within 42 consecutive days, which can take seven calendar rows. |
| `calendar` | optional | `week` or `month`: the week or the whole month the days are in, so a month's first few days still show the whole month. Without it, the weeks from the first day to the last. |

On a page with a [period](https://legatobar.com/docs/periods.md#periods), map `days` from a source's daily rows with `each`, using field names like `values[0]` for each item's value and `default: null` for missing readings, and set `calendar` from the period. A null default preserves the position of the next ring without turning an absent reading into zero. Show it only for a week or a month, beside a rings card for the period's average:

```json
{ "id": "each-day", "type": "pacing", "shape": "rings", "label": "Each day", "calendar": "month",
  "items": [ { "label": "Move", "value": 0, "target": 500, "unit": "kcal" },
            { "label": "Exercise", "value": 0, "target": 30, "unit": "min" },
            { "label": "Stand", "value": 0, "target": 12, "unit": "h" } ],
  "days": [ { "date": "2026-11-01", "values": [480, 35, 12] }, { "date": "2026-11-02", "values": [410, 22, 11] } ] }
```

## sparkline

[See examples](https://legatobar.com/features#card-sparkline)

A trend line.

| Field | | |
| --- | --- | --- |
| `label` | optional | Leave it out when the page's title already says what the line is, such as a Net Worth page's trend. |
| `points` | required | 2–240 numbers, oldest first. A card is about 330 points wide at full width, so more than 240 can't be told apart; average a longer series down with [`buckets`](https://legatobar.com/docs/mapping.md#mapping). |
| `max` | optional | The most the value can be, such as a machine's memory. The chart runs from zero up to it, with a dashed line there, so the fill shows how much of it is used, and the value reads "9.4 GB of 13 GB". A value over it still shows. A percentage pinned at `100` with `unit` `%`, such as a machine's CPU, keeps the 0–100% scale without the line or the "of 100%". |
| `target` | optional | A level the value is meant to reach or stay under, such as a car's charge limit. A dashed line, kept in view, and the value reads "69% · Limit 80%". Unlike `max`, the chart doesn't run from zero. |
| `target_label` | optional | The target's name, 1 to 24 characters. `Target` without one. |
| `right_unit`, `right_scale` | optional | A second scale on the right for the same line: the value times `right_scale`, in `right_unit` (1 to 8 characters). A car's battery reads in miles of range beside its percentage, with `right_scale` the miles for each percent, filled from its source. The value reads "69% · 224 mi". Give both or neither. |
| `change` | optional | `false` leaves out the badge beside the value that says how far it is from the first point. On by default; turn it off for a reading whose change isn't news, such as a machine's CPU or memory. |
| `width` | optional | `full` (the default) or `half`: a small chart that shares a row with the half-width card beside it, such as a machine's CPU beside its memory. Half width, `max`'s "of 13 GB" goes under the value, only the first and last labels sit under the line, and two charts in a row end on the same line. |
| `times` | optional | When each point was, one per point and in order: Unix seconds (or milliseconds) or ISO 8601. The points then sit at their moments rather than evenly spaced, and the line breaks where readings stop for more than three times their usual spacing (and at least 15 minutes), such as a car asleep overnight. Map it from the same list as `points`, with the same `each`. |
| `axis_labels` | optional | What's drawn under the line, one per point like `labels`, when it should be shorter than what the pointer shows: "9 PM" under the chart, "8:54 PM" on hover. Without it, `labels` are drawn there too. |
| `unit` | optional | |
| `start_label` | optional | 1–24 characters under the line's first point: the time it stands for, like `"12h ago"` or `"Oct 1"`. |
| `end_label` | optional | 1–24 characters under the last point: `"Now"`, `"Today"` or a date. |
| `labels` | optional | What each point stands for, one per point, oldest first, each 1–24 characters: `["Jan", "Feb", …]` or dates. |
| `shape` | optional | `smooth` (the default) joins the points with a curve; `sharp` joins them with straight segments, for values that shouldn't read as passing through the ones in between. |
| `grid` | optional | `true` draws lines across the chart at the axis's values. Off by default; the values down the leading edge show either way. |
| `series`, `points2` | optional | A second line on the same scale: two internet connections' latency, or download beside upload. `series` names the two lines (1 to 16 characters each) and `points2` holds the second's readings. Give both or neither. See [Two lines](#two-lines). |
| `times2` | optional | With `times` and `points2`: when each of `points2`'s readings was, as `times` is for `points`. |

A label that's empty, `null` or longer than 24 characters makes the card unreadable, from a page file or a source alike, and so do `labels` that don't have one for each point.

The card shows its label, then the latest value with its change since the first point. The change is a percentage, or the difference itself when a percentage would mislead: a unit of `%` or degrees, a first point of zero, or a change of sign. It's never coloured, since up isn't always good.

Under that is the line over a fading fill, its last point marked, with the values on an axis down its leading edge. With `labels`, up to five of them sit under the line: the first, the last and some evenly between. Without them, `start_label` and `end_label` sit under the ends. Rest the pointer on the line and the point under it is marked: the value, its change and its label show in the card's header until the pointer leaves.

When a service only reports a value as it is now, a sourced sparkline can draw its trend from readings the Mac records itself: see [Sparkline readings](https://legatobar.com/docs/mapping-sparklines.md#sparkline-readings). Such a card labels its points from its readings unless the page sets them: dates, ending with "Today", for daily readings; times, ending with "Now", for more often.

```json
{ "id": "cpu", "type": "sparkline", "label": "Host CPU", "unit": "%", "points": [12, 14, 11, 18, 22, 35, 41, 38, 27, 19],
  "start_label": "10m ago", "end_label": "Now" }
```

### Two lines

`series` and `points2` draw a second line on the same scale, in orange, without a fill. The header names each line beside a dot in its colour, with its latest reading: "● WAN 12 ms  ● WAN2 31 ms". Rest the pointer on the chart and each line shows its reading there. A line with no reading near the pointer shows "—". There's no change badge, since "since the first point" has no single answer for two lines, and no `right_unit`.

Without `times`, the two lines line up point for point, so `points2` has one reading for each of `points`. With `times`, give `points2` its own `times2`. Each line then sits at its own moments, and a reading one line doesn't have is a gap in that line, never a zero. A line breaks where its readings stop for more than one and a half times their usual spacing and twice the shortest, so a connection down for two hours of hourly readings breaks its own line there and leaves the other as it was. Readings averaged into `buckets` come one or two steps apart, and that never breaks a line. Either list can be empty while its line has no readings.

```json
{ "id": "latency", "type": "sparkline", "label": "Latency", "unit": "ms", "series": ["WAN", "WAN2"],
  "points": [9, 11, 8, 30, 9], "times": [1794900000, 1794903600, 1794907200, 1794910800, 1794914400],
  "points2": [24, 22, 26], "times2": [1794900000, 1794903600, 1794914400] }
```

From a source, map each line from its own rows with the same `each` for the points and their times:

```json
"points":  { "each": "wan1", "value": "ms", "buckets": 180 },
"times":   { "each": "wan1", "template": "{t}", "buckets": 180 },
"points2": { "each": "wan2", "value": "ms", "buckets": 180 },
"times2":  { "each": "wan2", "template": "{t}", "buckets": 180 }
```

```json
{ "id": "rate", "type": "sparkline", "label": "30-year mortgage rate", "unit": "%", "shape": "sharp",
  "points": [6.41, 6.38, 6.35, 6.37, 6.29, 6.22, 6.24, 6.18, 6.15, 6.11, 6.09, 6.12],
  "labels": ["Nov", "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"] }
```

## gauge

[See examples](https://legatobar.com/features#card-gauge)

A value within a range, with bands that say what the value means.

| Field | | |
| --- | --- | --- |
| `label` | required | |
| `value` | required | A number. One past either end sits at that end. |
| `min` | optional | The bottom of the range, `0` if left out. |
| `max` | required | The top of the range, above `min`. |
| `unit` | optional | |
| `bands` | optional | 1 to 6 of `{ "from", "to", "state" }`, in order. `from` defaults to `min` and `to` to `max`, and each `to` must be above its `from`. `state` is `ok`, `warning` or `critical`. |

Half width. The number, a track from `min` to `max` with each band in its colour and a dot where the value sits, and the range underneath. The band the value is in colours the number, names its state when it isn't `ok` (at full width), and counts toward the page's status and notifications exactly as a `status` would. Leave bands out for a plain reading that shouldn't count.

```json
{ "id": "cpu", "type": "gauge", "label": "CPU temperature", "value": 72, "max": 100, "unit": "°C",
  "bands": [ { "to": 70, "state": "ok" }, { "from": 70, "to": 85, "state": "warning" }, { "from": 85, "state": "critical" } ] }
```

## bars

[See examples](https://legatobar.com/features#card-bars)

Categories with a value each.

| Field | | |
| --- | --- | --- |
| `label` | required | |
| `items` | required | 1 to 20 of `{ "label", "value", "icon", "url" }`: a label of 1–40 characters, a number of 0 or more, optionally an [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the label, and optionally a [link](https://legatobar.com/docs/card-fields.md#links-to-other-pages) the whole row opens, such as each project's own page. Once any row links, every row keeps room for its arrow. |
| `unit` | optional | Applies to every value. |
| `max` | optional | The value a full bar stands for, above 0. Left out, the largest item fills its bar. |
| `fit` | optional | `true` shows as many rows as keep the page within the sidebar's length, or the panel's [minimum height](https://legatobar.com/docs/settings.md), at least 5, with **Show *N* more** only when some are left out. Without the sidebar or a minimum height, every row shows. |

One row per item: the label, a bar, the value. Order the items the way the reader thinks about them, largest first for spend, the ballot's order for votes.

```json
{ "id": "spend", "type": "bars", "label": "Spend by category", "unit": "USD",
  "items": [ { "label": "Groceries", "value": 412 }, { "label": "Dining", "value": 188 }, { "label": "Transit", "value": 64 } ] }
```

Bar values include their unit, such as `15 ms` or `18%`. In the Mac app, hover over a shortened row label to read it in full, or right-click it and choose **Copy label**.

## breakdown

[See examples](https://legatobar.com/features#card-breakdown)

What a total is made of: net worth by asset, a month's spend by category against its budget.

| Field | | |
| --- | --- | --- |
| `label` | required | |
| `items` | required | 2 to 6 of `{ "label", "value", "color", "icon" }`: a label of 1–40 characters, a number of 0 or more, and optionally a colour and an [icon](https://legatobar.com/docs/card-fields.md#item-icons). |
| `layout` | optional | `bar`, the default: one bar in segments over a legend. `rows`: a bar for each part. |
| `unit` | optional | Applies to every value. |
| `total` | optional | The headline when it isn't the items' sum, like net worth after debts. Say what it leaves out in `detail`. |
| `target` | optional | A budget the parts fill, above 0. The bar's full width stands for it, and the headline reads "$2,140 of $3,200". |
| `elapsed` | optional | With a `target`, the fraction of the period gone, from 0 to 1, as on a [`pacing`](https://legatobar.com/docs/card-numbers.md#pacing) card. |
| `detail` | optional | A line under the legend, up to 120 characters. |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more, such as a sleep breakdown leading to the nights before it, or an https address. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |

The label and the headline, then one bar split into a coloured segment per item, then a legend: each item's colour, label, value and share of the whole. The segments are in the items' order, so put the largest first unless the reader expects another. A segment too small to see still shows a sliver of its colour.

Without a `target`, the bar is the items' sum and the headline is that sum, or `total`. With one, the bar's full width is the target and the segments fill part of it. A tick marks pace when `elapsed` is set, and a line under the bar says the pace, as a [pacing](https://legatobar.com/docs/card-numbers.md#pacing) bar's does; the header's "$790 of $1,200" says the rest. Like pacing, it never changes the page's status dot.

`color` is one of `blue`, `teal`, `orange`, `purple`, `green`, `pink`, `yellow`, `red`, `rose` or `grey` (`gray` works too). Each Mac draws the system's shade of that colour for light or dark mode, so segments next to each other stay distinct on either background; that's why there's no hex. `purple` is the exception: a deeper violet than the system's, which leans pink. `graphite` is the theme's chart colour. Leave colours out and the items take five category colours in order: blue, aqua, yellow, violet and magenta, picked so neighbours stay apart for colour-blind readers. A colour that sits near one another item names is skipped, and a sixth item and any after it are grey. Name colours when the same category appears on several pages, so Investments is green wherever it's shown.

With `"layout": "rows"`, each part has a row of its own: its label, its segment on a track of its own, the same length it has in the one bar, then its value and share. An item's `icon` sits before its label in the part's colour, as it does in the legend, where it takes the colour dot's place. Rows suit parts you compare with each other, like a night's sleep stages; the one bar suits a single whole, like net worth. For a funnel, where each step is a share of the first rather than of a whole, use [`bars`](https://legatobar.com/docs/card-numbers.md#bars) with a `max`.

```json
{ "id": "sleep", "type": "breakdown", "label": "Sleep a night", "unit": "h", "layout": "rows",
  "items": [ { "label": "Deep", "value": 1.6, "color": "purple", "icon": "moon.zzz" }, { "label": "Core", "value": 4, "color": "blue", "icon": "moon" },
             { "label": "REM", "value": 1.7, "color": "teal", "icon": "eye" }, { "label": "Awake", "value": 0.5, "color": "grey", "icon": "sun.max" } ] }
```

A debt doesn't fit in the bar, since values are 0 or more. For net worth, list the assets and put what's owed in `total` and `detail`:

```json
{ "id": "worth", "type": "breakdown", "label": "Net worth", "unit": "USD", "total": 410000,
  "items": [ { "label": "Real estate", "value": 410000, "color": "blue" }, { "label": "Investments", "value": 268000, "color": "green" },
             { "label": "Cash", "value": 42000, "color": "teal" } ],
  "detail": "After the $310,000 mortgage" }
```

```json
{ "id": "october", "type": "breakdown", "label": "October spend", "unit": "USD", "target": 3200, "elapsed": 0.55,
  "items": [ { "label": "Groceries", "value": 940 }, { "label": "Dining", "value": 620 }, { "label": "Transit", "value": 330 } ] }
```

## flow

[See examples](https://legatobar.com/features#card-flow)

Where amounts go: sources down the left, destinations down the right, and a band from each source to each destination it sends to, as thick as its amount. DNS queries from each client to allowed and blocked, solar and grid to the house and the car, income to spending and savings.

| Field | | |
| --- | --- | --- |
| `label` | required | |
| `links` | required | 1 to 48 of `{ "from", "to", "value" }`: a source's label, a destination's label (each 1–40 characters) and an amount of 0 or more. Up to 6 sources and 8 destinations. |
| `from` | optional | The sources in the order to draw them, as `{ "label", "color" }`. Left out, they're the links' sources in the order they first appear. |
| `to` | optional | The destinations in the order to draw them, as `from`. |
| `unit` | optional | Applies to every amount. |
| `detail` | optional | A line under the chart, up to 120 characters. |
| `hide_amounts` | optional | `true` leaves out the amount under each source's name, so only the names show on the left. The headline total and each destination's share stay. Default `false`. |
| `url` | optional | Where a click on the card goes. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |

The headline is everything that flows. Each source's amount sits under its name, and each destination's share of the whole after its name, so the labels stay outside the bars. Every band is drawn on one scale at both ends. A node is as tall as what passes through it, but never shorter than its label, so a client with a handful of queries still has its name. When `from` or `to` is given, every link has to come from or go to one of them.

Colours are the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown) names. Sources left without one take the breakdown's category colours in order, skipping any near a colour a source or destination names, and destinations left without one are grey. A band takes its source's colour. Name colours when a destination means something, such as green for Allowed.

```json
{ "id": "queries", "type": "flow", "label": "DNS queries today",
  "to": [ { "label": "Allowed", "color": "green" }, { "label": "Blocked", "color": "grey" } ],
  "links": [ { "from": "Mac Studio", "to": "Allowed", "value": 3680 }, { "from": "Mac Studio", "to": "Blocked", "value": 530 },
             { "from": "Apple TV", "to": "Allowed", "value": 1310 }, { "from": "Apple TV", "to": "Blocked", "value": 650 } ] }
```

From a [source](https://legatobar.com/docs/mapping.md#mapping), map `links` with `each`. A service that lists each source once with two amounts gives two links per row: [derive](https://legatobar.com/docs/mapping.md#derived-values) a list for each destination, then join them with a two-path `each`. Pi-hole v6 lists its top clients with their queries at `/api/stats/top_clients`, and their blocked queries with `?blocked=true`:

```json
"requests": { "clients": "/api/stats/top_clients?count=5", "blocked": "/api/stats/top_clients?blocked=true&count=50" },
"derive": [
  { "name": "rows", "value": { "each": "clients.clients",
      "lookup": { "from": "blocked.clients", "by": "ip", "on": "ip", "as": "b" },
      "fields": { "name": { "if": { "path": "name", "equals": "" }, "then": "ip", "else": "name" },
                  "blocked": { "path": "b.count", "default": 0 },
                  "allowed": { "subtract": [ "count", { "path": "b.count", "default": 0 } ] } } } },
  { "name": "allowed", "value": { "each": "rows", "fields": { "from": "name", "to": { "template": "Allowed" }, "value": "allowed" } } },
  { "name": "blocked_links", "value": { "each": "rows", "where": { "path": "blocked", "gt": 0 },
      "fields": { "from": "name", "to": { "template": "Blocked" }, "value": "blocked" } } }
]
```

```json
{ "id": "clients", "type": "flow", "label": "Queries by client",
  "to": [ { "label": "Allowed", "color": "green" }, { "label": "Blocked", "color": "grey" } ],
  "source": { "ref": "pihole",
    "empty": { "when": { "value": { "count": "clients.clients" }, "equals": 0 }, "text": "No client queries to show." },
    "map": { "links": { "each": [ "allowed", "blocked_links" ],
      "fields": { "from": "from", "to": "to", "value": "value" } } } } }
```

The empty rule handles a successful answer with no clients. A missing client list still needs attention; it does not count as an empty list.

## ranges

[See examples](https://legatobar.com/features#card-ranges)

Rows on one shared scale, each a bar from its low to its high: a week's forecast, a price's range by day. The scale runs from the lowest low to the highest high, so the rows compare at a glance: a cold day's bar sits to the left of a warm one's.

```json
{ "id": "week", "type": "ranges", "label": "This week", "unit": "°F", "colors": "temperature", "items": [
  { "label": "Today", "icon": "cloud.rain", "low": 59, "high": 79, "now": 67 },
  { "label": "Thu", "icon": "sun.max", "low": 55, "high": 72 },
  { "label": "Fri", "icon": "cloud.sun", "low": 48, "high": 66 } ] }
```

| Field | | |
| --- | --- | --- |
| `label` | required | The card's title. |
| `items` | required | 1–14 rows, in order. Each has a `label` (up to 24 characters, like "Today" or "Thu"), a `low` and a `high` (either way round), and optionally an `icon` (an SF Symbol, or `si:`/`site:` as list rows take) `now`, a value marked on the bar with a dot, like the temperature now on today's row, and `info`, up to two short notes (10 characters each) in columns of their own, the first before the icon and the second after it, like a forecast's wind and chance of rain. An empty note leaves its column blank, so the columns stay lined up. |
| `unit` | optional | A degree unit (`°F` or `°C`) shows values as "72°"; a currency shows money. `clock` reads values as hours of the day and shows them as times: 22.5 is 10:30 PM, and 24 and up are the next day's, so a night from 10:56 PM to 8:01 AM is 22.93 to 32.02. A source rule's [`clock`](https://legatobar.com/docs/mapping-tables.md#names-and-exact-times) turns a timestamp into these hours. |
| `colors` | optional | `accent` (the default) draws every bar in the theme's chart colour. `temperature` shades each bar by its own temperatures, purple and blue when cold, through teal and green, to yellow, orange and red when hot, read in the card's unit (`°C`, otherwise °F), so 70°F always looks warm, whatever the rest of the week does. |
| `info_colors` | optional | The `info` columns' colours, in order, by the same names as a [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s: `["green", "blue"]` for wind and rain. Without it they're grey. |
| `muted` | optional | `false` shows each row's low in the text colour instead of grey, like its high. |
| `color` | optional | Every bar in one colour where it means something, such as charges in `green`. The chart colour without; `colors: temperature` shades by temperature instead. |
| `min`, `max` | optional | A fixed scale for every row, such as 0 to 100 for charges that ran from 38% to 72%, so a top-up and a full charge look different. Without them the scale runs from the rows' lowest low to their highest high. |
| `detail` | optional | A note under the rows. |

Full width. From a forecast, map each day with `each`, `{dt\|weekday}` for "Today", "Thu" and so on, and `{wind_deg\|compass}` for a wind's direction; see [Mapping](https://legatobar.com/docs/mapping.md#mapping).

With `unit` `clock`, a week of nights from bedtime to wake-up:

```json
{ "id": "bedtimes", "type": "ranges", "label": "Bedtime and wake-up", "unit": "clock", "items": [
  { "label": "Wed", "low": 22.9, "high": 32.62 },
  { "label": "Thu", "low": 22.91, "high": 31.97 },
  { "label": "Today", "low": 22.94, "high": 32.02 } ] }
```

## columns

[See examples](https://legatobar.com/features#card-columns)

Periods compared side by side, with up to three series in each.

| Field | | |
| --- | --- | --- |
| `label` | optional | Leave it out when the page already says what the columns are. |
| `series` | required | 1 to 3 names of 1–24 characters, in legend order. One series has no legend: the card's label names it. |
| `legend_align` | optional | `leading` (the default) puts the series names under the title; `trailing` puts them at the card's right, on the title's line. |
| `slots` | optional | Room for this many columns, 1 to 96. The columns not here yet are left empty at the end, so a day that's still going draws at its full width: `24` for a day's hours. |
| `summary` | optional | Grey words after the title, on its line: `"**14,623** · **23.3%** blocked"`. Up to 120 characters; inline formatting works. |
| `items` | required | 1 to 48 of `{ "label", "values" }`, oldest first: a period label of 1–12 characters and one number per series, in the same order. |
| `unit` | optional | Applies to every value. A degree unit writes values as "64°". |
| `baseline` | optional | `zero` (the default) starts the columns at zero. `auto` starts them just below the lowest value, for readings like an hour-by-hour temperature, whose shape matters more than how far it is from zero. |
| `values_on_top` | optional | `true` writes each column's value above it, in place of the side axis. |
| `highlight` | optional | The label of the period that applies now, like `"Now"` or this month's `"Oct"`: its label, and its value on top, are bold and bright, while every column keeps its colour. A label no item has highlights nothing. |
| `stacked` | optional | `true` draws one column per period with its series stacked as parts of it, such as a night split into sleep stages. Values on top then show each column's total, and the baseline is always zero. |
| `series_colors` | optional | The series' colours, in order, by the same names as a [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s: `["purple", "blue", "teal"]`. In a stacked chart, `grey` is a lighter grey for the part that isn't the subject, so the other part reads first: Pi-hole's Allowed under Blocked. |
| `grid` | optional | `true` draws lines across the chart at each of the side axis's values. Without it, one faint line marks the middle value. |
| `last_partial` | optional | `true` when the last column is a period still filling, such as the hour now or today. It's drawn lighter, so its shortness doesn't read as a drop. |
| `detail` | optional | A note under the chart, up to 200 characters. |

A legend, then a group of columns per period, with three values up the side: zero, the middle, and the next round number above the tallest column (7,500 for a peak of 6,100), so the columns use the room. Only the top of a column is rounded. Stacked parts have a hairline between them and the legend lists them top first; a column too short to draw its parts is a thin sliver on the baseline, so an almost empty hour doesn't look like a short bar. Without `series_colors`, one series is drawn in the theme's chart colour, and two or more take the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown)'s category colours in order. Resting the pointer on a period shows its values, and a stacked column's total. An item with fewer values than there are series draws the ones it has. Keep period labels short and distinct, like `May` or `Wk 42`, since they sit under narrow columns. Past 12 columns, only every few labels are written, counted back from the newest, so a day by hour reads every third hour; resting the pointer on a column still names it.

```json
{ "id": "flow", "type": "columns", "label": "Income vs spending", "unit": "USD", "series": ["Income", "Spending"],
  "items": [ { "label": "Aug", "values": [5400, 3980] }, { "label": "Sep", "values": [5400, 4475] }, { "label": "Oct", "values": [3600, 2210] } ],
  "detail": "October is through the 21st." }
```

Stacked, each column is a whole made of its parts, coloured as a breakdown's are:

```json
{ "id": "stages", "type": "columns", "label": "Sleep stages", "unit": "h", "stacked": true, "values_on_top": true,
  "series": ["Deep", "Core", "REM"], "series_colors": ["purple", "blue", "teal"],
  "items": [ { "label": "Wed", "values": [2, 3.8, 1.8] }, { "label": "Thu", "values": [3.5, 2.5, 0.9] }, { "label": "Today", "values": [0.8, 4.7, 1.9] } ] }
```

## tiles

[See examples](https://legatobar.com/features#card-tiles)

A grid of small tiles, four across, each with a label, a value and a change: a watchlist's symbols with their prices and how far each moved today. By default a tile has a light green wash when it's up and a light red one when it's down, a little deeper the further it moved, and the change is written in green or red. With `"style": "quiet"` the tiles stay plain and only the change is coloured, with ▲ or ▼. A change that rounds to zero, or a tile with no change, stays plain either way.

```json
{ "id": "watchlist", "type": "tiles", "max_items": 12, "items": [
  { "label": "NRWD", "value": "$184.62", "change": 2.32, "detail": "Northwind Traders", "url": "legato://page/stock?symbol=NRWD" },
  { "label": "CTSO", "value": "$72.15", "change": -4.51, "detail": "Contoso Systems" },
  { "label": "ZQXJ", "value": "No quote" } ] }
```

| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title. Leave it out in a tab that already names the tiles. |
| `items` | required | Up to 60 tiles, in the order given. Each has a `label` of 1–16 characters, like a symbol, and optionally a `value` (text up to 24 characters, like `"$184.62"` or `"72.15 EUR"`, or a number), a `change` (a number), a `detail` that shows when the pointer rests on the tile, like a company's name, and a `url` that a click opens: https, or `legato://page/ID` for another page. A tile with no `value` shows a dash. On a tile with no `change`, the value can run to two lines, for a note like "Check this symbol". An empty `items` says "Nothing to show yet". |
| `unit` | optional | What follows the change, `%` if left out. Any other unit comes after a space, and `""` shows the number alone. |
| `decimals` | optional | The change's decimal places, 0 to 4, or 2 if left out. |
| `scale` | optional | The change that gets the deepest tint, or 3 if left out. Smaller moves get lighter tints and larger ones the deepest. The scale is fixed, so a quiet day looks quiet. About 3 suits stocks in percent; coins move more, so try 10. |
| `max_items` | optional | Show only the first so many tiles, in order, with Show N more for the rest. |
| `style` | optional | `heat` (the default) washes each tile and colours the change; `quiet` leaves the tiles plain and colours the change, with an arrow. |
| `colors` | optional | `{ "up": …, "down": … }`, by the [breakdown](https://legatobar.com/docs/card-numbers.md#breakdown) names, such as `{ "up": "blue", "down": "orange" }`. Left out: green and red. |

Full width. The card writes the change with its sign, like "+2.32%" or "−4.51%", so map `change` to a number, never to a template. Tiles never count toward the page's status, a section's dot or a notification. VoiceOver reads each tile's label, value, change and detail.

From a source, map each row with `each`. Where there's nothing to compare, a condition with no `else` leaves `change` out and the tile stays plain:

```json
"map": { "items": { "each": "rows", "limit": 60, "fields": {
  "label": "symbol",
  "value": { "template": "${price|round:2}" },
  "change": { "if": { "path": "time", "gt": 0 }, "then": "change_percent" },
  "detail": "name",
  "url": { "template": "legato://page/stock?symbol={symbol|raw}" } } } }
```


---

# Lists and rows

## list

[See examples](https://legatobar.com/features#card-list)

Short lines of text.

| Field | | |
| --- | --- | --- |
| `label` | required | |
| `items` | required | Up to 500 lines; give a long one `max_items` so it opens short. Each is a string of 1–160 characters, with [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting), or a row object (below). |
| `style` | optional | How the lines are marked: `plain` (the default), `bullet`, `numbered` (1. 2. 3.) or `check` (a green check on each, for what's done or included). |
| `tone` | optional | `neutral` (the default), `info`, `success`, `warning` or `critical`: tints the card as a [`text`](https://legatobar.com/docs/card-text.md#text) card's tone does, and colours its bullets, numbers or checks. |
| `copyable` | optional | `true` gives each line a Copy button that copies its words without the formatting: prompts to try, commands, codes. |
| `max_items` | optional | Show no more than this many lines, with **Show *N* more** under them for the rest, as an [agenda](https://legatobar.com/docs/card-time.md#agenda)'s `max_events` does. For a long list where the first few matter most, such as recent tasks. |
| `paged` | optional | `true` turns a long list into pages of `max_items` lines, with a pager at the end of the title row (back, which lines show, and on) in place of **Show *N* more**. For a list too long to open all at once, such as a month of transactions. A page that starts partway through a day repeats its heading. |
| `fit` | optional | With `paged`: each page shows as many lines as keep the page within the sidebar's length, so the panel never grows past it for this list. At most `max_items` and at least 5, by whole lines as the sidebar and the rest of the page change. Without the sidebar, a page is `max_items` lines. |
| `aside_at` | optional | Where the rows' `aside` column sits: `end` (the default), between the words and the detail, or `start`, before the words. On a page with `"look": "sheet"`, a date at the start is drawn in a small grey box. |
| `sections` | optional | `days` groups the rows by date. Each row's `section` is its date, such as `2026-12-03` (a time on that day works too). The groups are Today, then each of the next seven days under its day of the month, then one group for each later month ("Later in December"), where each row shows its own date. Give the rows in date order. |
| `layout` | optional | `rows` (the default), `shelf` or `chips`: see [Shelf](https://legatobar.com/docs/card-lists.md#shelf) and [Chips](https://legatobar.com/docs/card-lists.md#chips). |
| `image_shape` | optional | `poster` (the default), `square` or `wide`: the items' [thumbnails](https://legatobar.com/docs/card-numbers.md#images-on-rows), unless an item sets its own. |
| `truncate` | optional | `middle` keeps each row's words on one line and cuts a long one in its middle, so both ends show: a long generated host name. The whole text shows on hover. |
| `headings` | optional | Grey names over the rows' columns, under a rule: `lead`, `text`, `aside` and `detail`, each up to 24 characters, such as Time, Domain, Client and Outcome. Each sits over its column. Rows that link show no arrow, so the last column ends at the card's edge. For a list read as a table, such as a log. |
| `total` | optional | How many there are at the service when the list holds only the first of them: a query log's 74,628 when it shows the latest 100. A source can set it from the answer's count, and "74,628" counts. A [tab with `counts`](https://legatobar.com/docs/card-text.md#tabs) shows it after its name. |
| `pager_at` | optional | `bottom` puts a paged list's pager under its rows, with "Showing 100 of 74,628" (or how many lines it holds) at the left, so nothing sits on the title row. For a list with `headings`, or one beside a detail pane. In a [layout](https://legatobar.com/docs/page-writing.md)'s cell of its own, such a list (or the tabs it's in) stretches to the cells beside it and shares the room left under its rows between them, a fraction of a point each, so its footer ends level with their last line. |

If an item contains ` · ` (space, middle dot U+00B7, space), the text after the last one is right-aligned, so `"Costco · $212"` reads as a name with an amount beside it. Long items wrap to two lines.

A row object is for a line that links somewhere, has a detail at its right, a grey line under it, or an icon before it:

| Field | | |
| --- | --- | --- |
| `text` | required | 1–160 characters, with inline formatting. |
| `url` | optional | An https link, or [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages). Clicking anywhere on the row opens it. Under the pointer (or with keyboard focus) the row gets a faint highlight and an arrow at its right, ↗ for a web link and → for a page, and its tooltip says where it goes ("Open ups.com", "Show the Pi-hole page"). Once any row has a link, every row keeps room for the arrow so the details line up. |
| `detail` | optional | Up to 40 characters at the row's right, like `"2h ago"` or `"$212"`. |
| `detail_color` | optional | The detail's colour, by the [breakdown card's names](https://legatobar.com/docs/card-numbers.md#breakdown), in a deeper shade made for text: a credit's amount in `green`. Only when the colour means something. |
| `selected` | optional | `true` draws the row on a grey plate: the row the page is showing now, such as the drive on a route map above the list. A source can set it from a comparison with the answer, `{"if": {"path": "ended_at", "equals": {"answer": "pick.results[0].ended_at"}}, "then": {"template": "true"}, "else": {"template": "false"}}`. |
| `aside` | optional | Up to 40 characters in a grey column on the row's one line: a transaction's category beside its payee, or a date before it (`aside_at`). Once any row has one, the asides and the details each keep one width down the card, so they line up, and the words stay on one line, cut short when long. |
| `lead` | optional | Up to 40 characters in a grey column at the very start of the row, before its words: a log line's time. Every lead keeps the widest one's width, so the words line up. |
| `spark` | optional | Up to 60 numbers, oldest first, drawn as thin grey bars before the row's detail: a client's queries through the day. Each row's bars are against its own highest, so they show its shape rather than its size. Once any row has one, every row keeps the room. |
| `subtitle` | optional | 1–80 characters of plain text on a grey line under the row's words: an issue's `"APP-214 · Due today"`, or who commented. It stays on one line, ending in "…" when it doesn't fit, and `detail` stays beside the first line. Drawn in the default `rows` layout only. |
| `icon` | optional | An [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the words: a carrier's logo on a package (`si:ups`), a service's on a status line, or a symbol (`shippingbox`). Once any row has one, every row keeps its space, so the words line up. |
| `image` | optional | A [thumbnail](https://legatobar.com/docs/card-numbers.md#images-on-rows) from the card's source, drawn in the icon's place. |
| `image_shape` | optional | The item's own shape, overriding the card's. |
| `section` | optional | A heading of 1 to 40 characters. Drawn when it differs from the row above, in the default `rows` layout only. |
| `key` | optional | The row's identity from one answer to the next, such as an item's id: text or a number. |

A row's `url` may also be plain http when it's on the card's source's own address or a private network address (such as `192.168.1.20`, `10.0.0.5` or a `.local` name), so rows from servers on your network link. A [`status`](#status) card's `url` follows the same rule. Other cards' links stay https.

Strings and row objects can be mixed in one list. A [source](https://legatobar.com/docs/source-examples.md#a-feed-the-latest-posts-each-linking-to-its-page) can fill one from a blog's or news site's feed.

Sourced rows can carry up to three places for buttons at their end: see [Buttons on each row](https://legatobar.com/docs/button-rows.md#buttons-on-each-row).

```json
{ "id": "top", "type": "list", "label": "Largest this week", "items": ["Costco · $212", "Delta Air Lines · $189"] }
{ "id": "steps", "type": "list", "label": "Deploy", "style": "numbered", "items": ["Run `make test`", "Tag **v2.15**"] }
{ "id": "ask", "type": "list", "label": "Try asking", "tone": "success", "copyable": true, "items": ["What would make a great page for me?"] }
{ "id": "posts", "type": "list", "label": "Latest posts", "items": [{ "text": "Swift 6.3 released", "url": "https://www.swift.org/blog/", "detail": "2h ago" }] }
{ "id": "issues", "type": "list", "label": "Assigned to you", "items": [{ "text": "Fix the login loop", "subtitle": "APP-214 · Due today", "detail": "In Review" }] }
```

### Chips

Use `"layout": "chips"` for short items in quiet rounded capsules. Chips wrap from left to right. Each shows its icon and one line of text. Long text ends with an ellipsis. Only an item's `color` tints its icon. A `url` makes the chip a link. The `detail` is a tooltip and is read by VoiceOver. Leave out `label` for no header. `max_items` keeps Show N more. Chips take no images, row actions, marks, Copy or Ask buttons.

```json
{ "id": "notes", "type": "list", "layout": "chips", "max_items": 3,
  "items": [{ "text": "Gusts Friday", "icon": "wind", "detail": "Gusts to 46 mph" },
            { "text": "Rain Sunday", "icon": "cloud.rain" }] }
```

### Shelf

With `"layout": "shelf"`, a list is up to four tiles across, each its [image](https://legatobar.com/docs/card-numbers.md#images-on-rows) at `image_shape`, then its `text` and a grey `detail`, each on one line and cut short: what was just added to a media library. Tiles keep a quarter of the width however few there are, so the shelf never stretches when an item arrives. `max_items` still applies, and **Show *N* more** adds rows of four. A tile with a `url` opens it. A tile without an image shows the placeholder (with its icon, if it has one). A shelf takes no `style`, `copyable` or `ask`, and no buttons on its tiles.

```json
{ "id": "new", "type": "list", "label": "Recently added", "layout": "shelf", "max_items": 4,
  "source": { "ref": "media", "map": { "items": { "each": "added", "fields": { "text": "name", "detail": "when",
    "image": { "template": "/Items/{id|raw}/Images/Primary?fillHeight=240" } } } } } }
```

A row object can have `section`, a heading of 1 to 40 characters. A heading appears when the row’s section differs from the row above. Sections show in the default `rows` layout only. With `max_items`, the first N rows stay in order and show their headings. Row links, icons and buttons keep their place.

## table

[See examples](https://legatobar.com/features#card-table)

A grid: service status, a short ledger, recent transactions.

| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `columns` | required | 1–8 column headings, 1–32 characters each. |
| `rows` | required | Up to 10 rows. Each row is a list with exactly one cell per column. A cell is a number or a string of up to 60 characters. |
| `one_line` | optional | `true` keeps every cell on one line, cut short with … rather than wrapping to two. For a table wide enough to read that way, such as a full-width list in a [page layout](https://legatobar.com/docs/page-writing.md#layout-in-the-window). |

A row with the wrong number of cells is an error (`Row has 3 cells; the table has 4 columns.`). A column of numbers or of amounts written as text (`"$1,099"`, `"+$4,925.00"`, `"12%"`, `"—"`) is right-aligned, and an amount written with a `+` is green, as money coming in is elsewhere. Numbers are shown as plain numbers, so put currency in a string (`"$1,099"`) or in the heading. The last column of words takes the width the card has to spare, so the figures sit at its right edge.

```json
{
  "id": "backups", "type": "table", "label": "Nightly backups",
  "columns": ["Host", "Finished", "GB"],
  "rows": [["nas", "02:14", 412.6], ["docker-vm", "02:31", 38.2]]
}
```

From a source, `rows` takes a list with `cells`: one rule per column, read from each element, so the table has as many rows as the answer gives. Keep `limit` at 10 or less. A cell with no text or number shows "—".

```json
"source": { "ref": "hub", "map": { "rows": {
  "each": "systems", "where": { "path": "status", "equals": "up" },
  "sort": { "by": "cpu", "order": "desc" }, "limit": 5,
  "cells": ["name", "cpu", "memory", "disk"] } } }
```

## status

[See examples](https://legatobar.com/features#card-status)

The health of one thing.

| Field | | |
| --- | --- | --- |
| `label` | required | The service or job. |
| `state` | required | `ok`, `warning`, `critical`, `unknown` or `off`. |
| `detail` | optional | Up to 120 characters: why, or when it last ran. |
| `icon` | optional | An SF Symbol drawn in place of the state's own icon, in the state's colour, such as `moon.fill` for a market that's closed. Set it from a rule to change it with the answer. A name the Mac doesn't have shows the state's icon. |
| `url` | optional | Where a click on the card goes: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with the details, or an https address. Plain http works too on the card's source's own address or a private network address, as it does for a [list row](#list), so a server's health card can open its web interface at `http://192.168.1.20` or `http://tower.local`. See [Cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link). |
| `width` | optional | `half` (the default) shares a row with the half-width card beside it. `full` gives the card the whole row, as a page's main status above a row of tiles. |
| `placement` | optional | `"page_info"` puts the card in [Details](https://legatobar.com/docs/page-behavior.md#page-info), and the page leaves it out. See [In Details](#in-page-info). |

Each state has its own icon and colour: a green check, an orange triangle, a red octagon, a grey question mark, a grey power symbol for `off`. `icon` swaps the symbol and keeps the colour. `unknown` means the answer couldn't say; `off` means not running, and that's fine, such as a machine shut down on purpose. `off` counts as `ok` for the page's status, a section's dot and notifications. At full width, a state other than `ok` is also named beside it, such as "Warning"; an `ok` card lets the check say so. A page's status is the worst state among its `status` cards, the band a [`gauge`](https://legatobar.com/docs/card-numbers.md#gauge) is in and the items of a [`fleet`](https://legatobar.com/docs/card-lists.md#fleet). A move up to `warning` or `critical` posts a [notification](https://legatobar.com/docs/notifications.md).

```json
{ "id": "backup", "type": "status", "label": "Offsite backup", "state": "warning", "detail": "Last run 31 hours ago" }
```

<a id="in-page-info"></a>

### In Details

A service's own health belongs in Details, out of the way until it needs a look. Give its `status` card, or a `fleet` of its parts, `"placement": "page_info"`. The page doesn't draw it, and a heading whose cards all went there isn't drawn either. Details lists it first, under Health, with its whole detail and every item of a fleet. A row with a `url` opens it from there.

The Details button beside the page's title is always the same grey list, whatever its health cards say. A card that isn't `ok` or `off` shows in the line under the title, [notifies](https://legatobar.com/docs/notifications.md) and counts in the [Dock badge](https://legatobar.com/docs/notifications.md#the-dock-badge).

The card still counts for the page's status, notifications, Spotlight and Shortcuts, as it would on the page.

```json
{ "id": "health", "type": "status", "placement": "page_info", "label": "Radarr", "state": "ok", "width": "full", "detail": "Radarr 5.26 · No problems" }
```

Only a top-level `status` or `fleet` can go in Details. A card in a tab stays on the page, and a card in Details has no buttons (`actions`, `actions_placement`, `actions_align`, `row_actions`): put them on a card the page draws.

## map

[See examples](https://legatobar.com/features#card-map)

Places on a map: where the car is parked, a package, a trip's stops. Legato shows Apple's map around the pins in its muted style, held still: it doesn't drag or zoom. A click on a pin opens that place in Maps; anywhere else on the card, the area around the pins (or the place, with one pin). Apple's logo and Legal link show on it.

| Field | | |
| --- | --- | --- |
| `pins` | required | Up to 10 places, each a `lat` (-90 to 90) and a `lon` (-180 to 180), or a `place` in words (up to 200 characters, like `"Anaheim, CA 92899"`). Each takes an optional `label` (up to 40 characters, under the pin and the place's name in Maps) and `icon` (an SF Symbol in the pin, like `car.fill`; a plain dot without one). When a pin has both, its `lat` and `lon` win. An empty list says "No location yet", as a card waiting on its source does. |
| `label` | optional | The card's title. |
| `radius` | optional | How far around the pins the map shows, in metres, 50 to 5,000,000. Without it, enough to show every pin, and at least 400 m. |
| `detail` | optional | A line under the map, up to 200 characters. |
| `track` | optional | A recorded path, oldest first, up to 3,000 `{ "lat", "lon" }`: a drive's route as the car logged it, one solid light line with a hollow dot where it starts and a filled one where it ends, the map framed on it. Points at 0,0 or off the globe are left out. |
| `height` | optional | The map's height in points, 120 to 600. 150 without it; a route deserves 300. |
| `url` | optional | Where a click off the pins goes instead of Maps: an https address, or `legato://page/ID`. |
| `route` | optional | `true` joins the pins in order, oldest first, with a dashed line. See [Routes](https://legatobar.com/docs/card-lists.md#routes). |
| `route_icon` | optional | The SF Symbol on a route's last stop. Without it, `box.truck.fill`. |
| `open_maps` | optional | `false` turns off opening Maps: a click on a pin or the map does nothing, unless `url` is given. Without it, `true`. |

Full width. Each pin is a dot in the accent colour. A click on a pin opens that place in Maps, and a click elsewhere opens the area around the pins. Give `"open_maps": false` for a map that only shows where things are, such as a package's route. A source fills the pins like any list: `pins[0].lat` and `pins[0].lon` for one place, such as the car's `drive_state.latitude` and `drive_state.longitude` from Tessie, or `each` for several.

```json
{ "id": "car", "type": "map", "label": "Car", "pins": [ { "lat": 37.7955, "lon": -122.3937, "label": "Model Y", "icon": "car.fill" } ] }
```

### Places in words

Some services name a place but don't say where it is. A parcel's scans read like "ANAHEIM, CA 92899". Give a pin that text as its `place`, and Legato looks it up with Apple Maps after the page is drawn. The answer is kept on this Mac, so each place is looked up once. Only the place's words are sent to Apple, never the rest of the page.

Until a place is found, its pin isn't drawn. A card with none found yet says "Locating…". When every place has been looked up and none was found, it says "Couldn't find these places on the map". A place that wasn't found is tried again a day later. A lookup that fails because the Mac is offline is tried again soon, and the card keeps saying "Locating…".

### Routes

With `"route": true`, the pins are stops in the order you give them, oldest first. Legato joins them with a dashed line, draws the earlier stops as small dots and the last stop with `route_icon`. Only the last stop is named under its pin. The line is where the package was scanned, one stop to the next. It isn't a calculated route.

A stop that isn't found breaks the line there. When the last stop isn't found, no stop is drawn as the current one, so an earlier scan never looks like where the package is now.

A source fills a route from a list of scans with `each`. Parcel sends them newest first, so sort them oldest first, keep one stop per place in a row with `collapse`, and keep the newest 10 with `last`:

```json
{ "id": "route", "type": "map", "label": "Route", "route": true, "open_maps": false, "pins": [],
  "source": { "ref": "parcel", "map": {
    "pins": { "each": "events", "sort": { "by": "date", "as": "date" }, "collapse": "location", "last": 10,
              "fields": { "place": "location", "label": "location" } } } } }
```

## facts

[See examples](https://legatobar.com/features#card-facts)

A few labelled values.

| Field | | |
| --- | --- | --- |
| `label` | optional | A heading above the rows. |
| `items` | required | 1 to 12 of `{ "key", "value", "icon", "url" }`. A `key` is 1–40 characters; a `value` is a string of up to 80 characters or a number; an optional [item icon](https://legatobar.com/docs/card-fields.md#item-icons) goes before the key. An optional `url` makes the line a link, as a [list row's](https://legatobar.com/docs/card-lists.md#list) is: [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages) with more about that value, or an https address. |
| `muted` | optional | `true` shows each row's label in grey, so the values stand out. |

Keys in a grey column with the values beside them, in the order sent. Use it for the things someone would otherwise look up: an order number, the carrier, the ETA.

A line with a `url` opens it when clicked. Under the pointer (or with keyboard focus) the line gets a faint highlight and an arrow after its value, → for a page and ↗ for a web address. Once any line links, every line keeps room for the arrow so the values line up. A detail page per line suits readings with a history: resting heart rate leading to its last 30 days.

```json
{ "id": "order", "type": "facts", "label": "Order 4821", "items": [
  { "key": "Carrier", "value": "UPS" }, { "key": "Tracking", "value": "1Z 999 AA1 01 2345 6784" }, { "key": "ETA", "value": "Thursday by 9 PM" } ] }
```


With `"layout": "figures"` and two to four items, the readings sit side by side, each a large figure with its key under it, the first in the text colour and the rest in grey: inside 55°, outside 46°. With `"layout": "line"` and two to six items, they sit on one quiet line, each value followed by its key in grey, such as a period's totals under its picker: **190 mi** 16 drives **228** Wh/mi. On a card too narrow for the line, they stack.

With `"layout": "wheels"` and exactly four items, in the order front left, front right, rear left, rear right, the card draws a car from above with each value by its wheel: a car's tire pressures. An item's `color` colours its value, so a low tire reads orange by its wheel; `grey` is the text colour, for a rule's "nothing wrong". Take the colour from the car's own warning flags, not a threshold of your own:

```json
"items[0].color": { "if": { "path": "vehicle_state.tpms_soft_warning_fl", "equals": true },
                    "then": { "template": "orange" }, "else": { "template": "grey" } }
```

## vehicle

A car from above, large, with its state drawn on it: each tire's reading by its wheel, a lock on the roof while it's locked, a green glow at the charge port while it charges, and anything open in orange where it is. Pair it with the car's state and battery beside it.

| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `tires` | optional | Exactly four `{ "value", "color" }`, front left, front right, rear left, rear right. `color` as a facts row's: orange for a low tire; grey or none draws as usual. |
| `unit` | optional | The tires' unit, small in the body (`psi`). |
| `locked`, `charging` | optional | true or false. |
| `doors_open`, `frunk_open`, `trunk_open`, `windows_open` | optional | true or false, as the car reports them; a `values` lookup turns a 0 or 1 into one. |

## fleet

[See examples](https://legatobar.com/features#card-fleet)

One dot per host, job or device, for many of them at once.

| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title. A fleet in a [tab](https://legatobar.com/docs/card-text.md#tabs) leaves it out when it would repeat the tab's name: it then has no header row and no count, and its notifications are named by the tab. |
| `items` | required | 1 to 60 of `{ "name", "state", "detail", "url", "group" }`: a name of 1–24 characters, a state of `ok`, `warning`, `critical`, `unknown` or `off`, an optional detail of up to 80 characters shown on hover, an optional `url` the item opens when it's clicked (https, or [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages)), and an optional `group` of 1–24 characters, a small heading the item sits under. |
| `max_items` | optional | Show no more than this many items, 1–60, with **Show *N* more** under them for the rest. What needs attention shows first. |
| `placement` | optional | `"page_info"` puts the fleet in Details, every item listed under its group, as a server's tasks and plugins. See [In Details](#in-page-info). |

A grid of named dots in as many columns as fit, with "24 ok", "23 ok · 1 off" or "2 of 24 need attention" in the corner. An `off` item has a grey dot and doesn't need attention: use it for a machine that's stopped on purpose, and keep `critical` for one that should be running. The worst state among the items counts toward the page's status dot, like a `status`, with `off` counting as `ok`. It replaces a column of status cards when there are more than a few.

An item with a `url` is a link to the service it stands for. Under the pointer (or with keyboard focus) it gets a faint highlight and an arrow after its name, its tooltip says where it goes ("Open Gitea · gitea.example.com", then the detail), and a click anywhere on it opens the address. With `legato://page/ID` the arrow is →, the tooltip says "Show the Pi-hole page", and a click shows that page. Only `https` addresses and pages open, as with every link in Legato; a source that reports an `http` one (a service checked on a local port) leaves that item plain. When the address a monitor checks is a health endpoint rather than the app, the [`origin` filter](https://legatobar.com/docs/mapping.md#mapping) keeps only its scheme and host: `{"template": "{monitor_url|origin}"}`.

```json
{ "id": "hosts", "type": "fleet", "label": "Hosts", "items": [
  { "name": "nas", "state": "ok" }, { "name": "pi-hole", "state": "ok" }, { "name": "backup", "state": "warning", "detail": "last run 31 hours ago" },
  { "name": "home-assistant", "state": "ok", "url": "https://ha.example.com" } ] }
```

A big fleet, such as thirty monitors, stays one card. `max_items` keeps it to a size that fits the panel. When there are more items than that, it shows the critical ones first, then warnings, then unknown, then the rest in the page's order; `off` counts as fine. **Show *N* more** brings back every item, in the page's order. When nothing is cut, the items keep the page's order. Show *N* more isn't remembered once the card goes from view: another page, a closed section or another tab shows it cut again. The corner count, the page's status, a section's or tab's dot, notifications, Spotlight and Shortcuts count every item, shown or not, so a hidden item that goes critical still notifies.

An item is known by its name for its notifications and the page's Recent activity. When two items can share a name, such as a fork beside the repository it came from, give each a `key` that stays the same from one answer to the next: Gitea's repository fleet uses `{"template": "{owner}/{name}"}`. Never put a secret in it.

`group` splits the dots under small headings, such as Services, Jobs and DNS, rather than a fleet for each. Items with no group come first, with no heading. Then each group follows, in the order its first item appears, holding its items in the page's order. Every group's dots line up in the same columns. With `max_items`, the items shown are chosen across the whole card first, then drawn in their groups. A group with nothing shown leaves out its heading. A group is trimmed of spaces and matched exactly, so `Jobs` and `jobs` are two groups. Two to four large groups read best.

```json
{ "id": "monitors", "type": "fleet", "label": "Monitors", "max_items": 24, "items": [
  { "name": "git", "state": "ok", "group": "Services", "url": "https://git.example.com" },
  { "name": "wiki", "state": "critical", "group": "Services", "detail": "502 for 4 minutes" },
  { "name": "nightly backup", "state": "warning", "group": "Jobs", "detail": "last run 31 hours ago" },
  { "name": "resolver", "state": "ok", "group": "DNS" } ] }
```

## checklist

[See examples](https://legatobar.com/features#card-checklist)

Items that are done or not.

| Field | | |
| --- | --- | --- |
| `label` | optional | The title, with the count of done items beside it. Leave it out for a checklist inside a tab that already names it: the card then has no title row, and its rows start at the top. |
| `items` | required | Up to 20 of `{ "text", "done", "detail", "icon", "badge", "badge_label", "badge_at", "section" }`: text of 1–120 characters, `true` or `false`, an optional [item icon](https://legatobar.com/docs/card-fields.md#item-icons) between the mark and the text, and optionally a `detail` of up to 120 characters, a second line under the text in smaller grey type, as Reminders shows a reminder's list. Both take [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting). A `badge` is an SF Symbol set into the start of the text in the accent colour, such as a to-do app's repeat mark (`arrow.clockwise.circle.fill`); unlike an icon it takes no room on rows without one. `"badge_at": "end"` puts it after the text in grey instead. A checklist item can give its badge a `badge_label`, such as `"High priority"`, for VoiceOver. Repeat, flag and pin badges have spoken defaults; use `badge_label` for other meanings. A `section` is a heading the row sits under: a row whose section differs from the row above starts a new one, as a to-do app groups its Upcoming by day (list layout only). An empty list is allowed, for a day with nothing due. |
| `mark` | optional | How a done item looks. `check` (the default): the circle turns into a checkmark and the text is struck through. `fill`: the circle fills and the text goes light, as in Reminders. `square`: a rounded square fills with a checkmark and the text goes light. `switch`: for things that are on or off, such as lights. Each item's icon is its mark (a symbol name, such as `lightbulb`; a power symbol otherwise), lit when `done` and dim when not, the text stays as it is, and the corner counts how many are on. A lit light, and anything else, glows yellow; fans (`fan`, `fan.ceiling`) and shades and blinds (`blinds.horizontal.open`, `window.shade.closed`) light in Legato's accent blue. |
| `layout` | optional | `list` (the default): a row per item. `grid`: two columns of small tiles, each item's mark beside its text with the `detail` under it. An item that's on (`switch`) or done tints its tile, and the whole tile is the item's action. For things you scan for state and toggle, such as a room's lights, shades and fans. A build that doesn't know `grid` shows the list. |
| `max_items` | optional | Show no more than this many rows, with **Show N more** for the rest, as a [list](https://legatobar.com/docs/card-lists.md#list)'s does. The corner still counts every row. Items written into the page stop at 20; a checklist a source fills can hold more, such as a to-do app's Upcoming. |

The corner counts "2 of 5". Without an `itemAction` the list is read-only: whatever writes the page writes it again as things get done. A checklist filled from a [source](https://legatobar.com/docs/button-rows.md#one-action-per-checklist-row) can give the rows an `itemAction`, so ticking one sends that item's request.

```json
{ "id": "release", "type": "checklist", "label": "Release 2.4", "items": [
  { "text": "Tag the build", "done": true }, { "text": "Write the notes", "done": false, "detail": "Maya · due Thursday" },
  { "text": "Submit for review", "done": false } ] }
```

A room's lights as a grid of switches:

```json
{ "id": "lights", "type": "checklist", "label": "Lights", "mark": "switch", "layout": "grid", "items": [
  { "text": "Ceiling", "done": true, "detail": "80%", "icon": "lightbulb" },
  { "text": "Table lamp", "done": false, "detail": "Off", "icon": "lightbulb" } ] }
```



---

# Text and layout

## text

[See examples](https://legatobar.com/features#card-text)

A note, or a callout.

| Field | | |
| --- | --- | --- |
| `label` | optional | A heading above the note. |
| `body` | required without buttons | 1–500 characters, with [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting). A card with a [source](https://legatobar.com/docs/buttons.md#buttons) and buttons can leave it out, for a card that is only its label and buttons, such as a machine's Controls. |
| `tone` | optional | `neutral` (the default), `info`, `success`, `warning` or `critical`. |
| `icon` | optional | An SF Symbol name, drawn before the body in the tone's colour. |
| `style` | optional | `plain` (the default), `quote`, which draws the body as a quotation with a bar down its leading edge in the tone's colour, or `cover`, which makes the card a page's front: the `label` large, the body under it. Use `cover` for a page's first card only. |
| `fill` | optional | `blue`, `sky`, `lilac` or `green`: a soft tint with a fine grain behind the card, in place of the tone's, deeper in dark mode. For a page's cover or a note that opens a page. A fill never means a state and never changes the page's status; use a `tone` or a `status` card for that. |
| `note` | optional | A short reading at the right of the title's line, up to 40 characters, such as "68° in · 66° out" beside a car's Climate buttons. One line, usually filled from a source. Needs a `label`. |

Any tone but `neutral` adds an icon and tints the card; `icon` replaces that icon with your own, which with a tone makes a callout, like 👋 at the top of a page. Tones never change the page's status dot; use a `status` card when something needs attention.

```json
{ "id": "note", "type": "text", "body": "Dining is 18% over pace.", "tone": "warning" }
{ "id": "hello", "type": "text", "tone": "info", "icon": "hand.wave", "body": "**Welcome.** Ask your assistant for a page; see [the quickstart](https://legatobar.com/docs/quickstart)." }
{ "id": "said", "type": "text", "style": "quote", "body": "**12 of 16** sessions were false alarms." }
{ "id": "cover", "type": "text", "style": "cover", "fill": "blue", "label": "Home lab", "body": "Three servers, the network and the backups." }
```

### Inline formatting

A `text` card's `body`, a `list`'s `items`, a `checklist` item's `text` and `detail`, and a `heading`'s `text` take Markdown's inline formatting:

| Write | Shows |
| --- | --- |
| `**bold**` | **bold** |
| `*italic*` or `_italic_` | *italic* |
| `~~gone~~` | ~~gone~~ |
| `` `code` `` | `code`, in a monospaced font |
| `[the docs](https://legatobar.com)` | a link; only `https` links and [`legato://page/ID`](https://legatobar.com/docs/card-fields.md#links-to-other-pages) open, others show their words |

Block Markdown (headings, `-` lists, code fences) shows as written: use a `list` with a `style`, or a [`code`](https://legatobar.com/docs/card-text.md#code) card, for those. To keep a literal `*` or `_`, write `\*` or `\_`. For text a source fills from a service, such as an error's title, the [`verbatim`](https://legatobar.com/docs/mapping-tables.md) filter does this for every mark. Older versions of the Mac app show the formatting characters as they are.

## link

[See examples](https://legatobar.com/features#card-link)

A button that opens a web page, with an optional icon and a second line.

| Field | | |
| --- | --- | --- |
| `label` | required | The button's text. |
| `url` | required | An `https://` URL with no spaces, up to 2048 characters, or [`legato://page/ID`](https://legatobar.com/docs/card-fields.md#links-to-other-pages). |
| `detail` | optional | A second line under the label, up to 120 characters: a song's name, what's at the link. |
| `icon` | optional | An SF Symbol name in place of the default compass, like `music.note` or `doc.text`. |
| `tone` | optional | Colours the icon: `info` blue, `success` green, `warning` orange, `critical` red. Default `neutral`. |
| `layout` | optional | `button` (the default) or `tile`. |

The button shows the label and the URL's host, and opens the URL in the browser only when you click it. Only `https` URLs with a host are accepted, and the Mac checks again before opening one. A link to another page shows that page's name in place of the host.

```json
{ "id": "pr", "type": "link", "label": "Open the pull request", "url": "https://github.com/example/app/pull/482" }
{ "id": "listen", "type": "link", "label": "Music while you look around", "detail": "The Meadows - A Place To Rest",
  "icon": "music.note", "tone": "success", "url": "https://open.spotify.com/track/3tCCbZaqd3GPy7jcWibXKq" }
```

With `"layout": "tile"`, a link card is half width, like a `stat`, and pairs with the half-width card after it. Its icon (in the accent colour unless `tone` says otherwise) sits beside the label, with the detail under it. The whole card is the link, lit with its arrow under the pointer, as [cards that link](https://legatobar.com/docs/card-fields.md#cards-that-link) are. Tiles suit a grid of places to go that each show a line of state, like rooms and how many lights are on; a source can fill the detail. A tile whose page is missing isn't a link.

```json
{ "id": "kitchen", "type": "link", "layout": "tile", "label": "Kitchen", "detail": "2 lights on", "icon": "fork.knife",
  "url": "legato://page/kitchen" }
```

## code

[See examples](https://legatobar.com/features#card-code)

A block of code or a command: a config fix, a `curl` to try, a log excerpt.

| Field | | |
| --- | --- | --- |
| `label` | optional | A heading above the code. |
| `language` | optional | A short name shown as a small label, like `yaml`, `bash` or `json`: 1–24 characters of `a–z`, `0–9`, `+`, `#`, `.` and `-`. |
| `code` | required | 1–4,000 characters, shown exactly as written, line breaks and spaces included. |

Full width, in a monospaced font with a **Copy** button. Long lines scroll sideways rather than wrap, and past about 16 lines the block scrolls down too. The code isn't coloured. Older versions of the Mac app show a card saying they can't draw it.

```json
{ "id": "fix", "type": "code", "label": "The fix", "language": "yaml",
  "code": "trigger:\n  - platform: numeric_state\n    above: 3.0\n    for: \"00:01:30\"" }
```

## heading

[See examples](https://legatobar.com/features#card-heading)

A section title that splits a long page into parts.

| Field | | |
| --- | --- | --- |
| `text` | required | The title: 1–80 characters, with [inline formatting](https://legatobar.com/docs/card-text.md#inline-formatting). |
| `detail` | optional | A line under the title, up to 120 characters. |
| `icon` | optional | An SF Symbol name before the title, in the accent colour. |
| `collapsed` | optional | `true` starts the section closed. Default `false`. A closed section opens by itself when its page comes into view with a critical card inside, or when the page's first answer arrives just after you open it and is critical. On a page with params, each item keeps its own open and closed sections. A section you close yourself stays closed while it's critical. Once it has been ok or a warning and turns critical again, it opens on your next visit. |
| `cards` | optional | The ids of the cards its section holds, which come right after the heading, in any order. The cards after them stay on the page outside the section. Without it, every card up to the next heading. |

Full width, larger than a card's label, with no card around it. The cards after a heading, up to the next heading, are its section: a click on the heading closes or opens them, and a chevron at its right says which. A section that starts closed suits detail someone might want, like a second option or a long log, without it taking the page. The Mac remembers a click while Legato runs; the next write keeps it. Cards in a closed section still count toward the page's status and notifications. A heading whose cards all go in [Details](https://legatobar.com/docs/card-lists.md#status) (`"placement": "page_info"`) isn't drawn.

A section can hold just a few cards. List them in `cards`, and the heading opens and closes only those; the cards after them carry on as part of the page, outside it. Here the host and its nightly backup share a section and a dot, and the charts after them don't:

```json
{ "id": "health", "type": "heading", "text": "Health", "cards": ["host", "backup"] }
{ "id": "host", "type": "status", "label": "pve-lab", "state": "ok" }
{ "id": "backup", "type": "status", "label": "Nightly backup", "state": "ok" }
{ "id": "cpu", "type": "sparkline", "label": "CPU", "points": [7, 9, 8] }
```

A heading whose section holds status, gauge or fleet cards has a dot before its chevron, open or closed, in the colour of the worst of their states: green when all are OK, grey for unknown, orange or red when one needs attention. Cards in every tab of a tabs card in the section count, as they do for the page's status. A section with no such cards has no dot.

```json
{ "id": "found", "type": "heading", "text": "What I found", "icon": "magnifyingglass", "detail": "A week of history" }
{ "id": "option-b", "type": "heading", "text": "Prefer an instant response?", "detail": "Option B", "collapsed": true }
```

## tabs

[See examples](https://legatobar.com/features#card-tabs)

Two to five tabs in one place on the page, each with its own cards. A click on a tab's name shows its cards in place of the others'.

| Field | | |
| --- | --- | --- |
| `tabs` | required | 2–5 tabs, left to right. Each is `{label, cards}`. |
| `tabs[].label` | required | The tab's name: 1–24 characters, like `Hacker News` or `This week`. |
| `tabs[].cards` | required | 1–12 cards, laid out as a page's are, so two half-width cards share a row. Any type but `tabs` and `heading`. |
| `same_height` | optional | `true` keeps every tab at the height of the tallest, so switching tabs never moves the cards below. The shown tab's last card stretches to fill the room. Without it, each tab is as tall as its own cards. |
| `counts` | optional | `true` follows each tab's name with how many its first list holds: the list's [`total`](https://legatobar.com/docs/card-lists.md#list) when it has one, else its lines. The tabs then double as the totals: All 74,628, Blocked 15,000. |
| `search` | optional | A search field at the end of the tab names, for a page with [params](https://legatobar.com/docs/detail-pages.md): `param` names the one the words go in, `prompt` is its grey placeholder (up to 24 characters), and `match` is `contains` (the default), which sends the words between `*` wildcards, or `exact`. Return opens the page with them, and the clear button goes back to the param's default. The field shows what the param holds now, so a link that filtered the page shows its filter. |

Full width. The names sit in a row like card labels: the one showing in bold with the accent colour under it, the others lighter. Names that don't fit scroll sideways.

Give `"same_height": true` to tabs of lists that change length, such as Due, Upcoming and Inbox: a short list then keeps the long one's height instead of pulling the page up.

Leave it off when the tabs are the last card on the page, since nothing below them can move. Leave it off too when one tab is much taller than the others: a short tab, such as a chart, then sits at the top of a mostly empty card.

The first tab shows until someone picks another. Legato remembers the selected position for that page and card across launches.

Labels may repeat. Renaming or reordering tabs keeps the same position selected; if that position no longer exists, the first tab shows. Saved choices contain positions, not tab labels.

Tabs suit views of one thing that would otherwise stack down the page: several feeds, today against this week, one server or repository each. Cards in a tab that isn't showing still count. Their status, gauge and fleet states count toward the page's status and notify as on the page, a tab whose cards need attention has an orange or red dot after its name, and Spotlight and Shortcuts read them.

Card ids are unique across the whole page, cards in tabs included. A tabs card counts as one of the page's 24 cards, since only one tab shows at a time; the cards in its tabs don't, up to 120 cards on the page in all. Older versions of the Mac app show a card saying they can't draw it.

```json
{ "id": "servers", "type": "tabs", "tabs": [
  { "label": "Today", "cards": [
    { "id": "requests", "type": "stat", "label": "Requests", "value": "1.2M" },
    { "id": "errors", "type": "stat", "label": "Errors", "value": 31 } ] },
  { "label": "Web", "cards": [
    { "id": "web-1", "type": "status", "label": "web-1", "state": "ok" },
    { "id": "web-2", "type": "status", "label": "web-2", "state": "critical", "detail": "Not answering" } ] },
  { "label": "Database", "cards": [
    { "id": "db", "type": "status", "label": "Primary", "state": "warning", "detail": "Replica lag 40s" } ] }
] }
```


---

# Time

## countdown

[See examples](https://legatobar.com/features#card-countdown)

Time until a moment, or since one.

| Field | | |
| --- | --- | --- |
| `label` | required | What happens then. |
| `at` | required | When, as ISO 8601 with seconds and a zone: `2027-03-12T19:15:00-04:00` or `2027-03-12T23:15:00Z`. Or Unix seconds, as services such as a weather API send a sunset, so a source can map it straight in: `{ "at": "current.sunset" }`. |
| `detail` | optional | Up to 120 characters: the gate, the price. |

Half width. The Mac counts down on its own between writes ("9d 4h", "2h 14m", "14m 32s"), shows "Now" at the moment and "2h 14m ago" after it, with the time or date under the count. Write the moment itself, not the time remaining, so the count stays right however long it is until the next write.

```json
{ "id": "boards", "type": "countdown", "label": "Flight boards", "at": "2027-03-12T19:15:00-04:00", "detail": "Gate B22" }
```

## window

[See examples](https://legatobar.com/features#card-window)

A window of time in the day, such as daylight, a store's hours or off-peak charging, drawn on one bar from midnight to midnight with now on it.

| Field | | |
| --- | --- | --- |
| `start` | required | When it starts: ISO 8601 with seconds and a zone, or Unix seconds as services send it. |
| `end` | required | When it ends, after the start and within a day of it. A window can cross midnight, such as 9 PM to 6 AM. |
| `next_start` | optional | When it next starts, so the time after it counts down to that. |
| `label` | optional | The headline in the window, up to 60 characters, like "Daylight left". Default "Left". |
| `before_label` | optional | The headline before it starts, like "Until sunrise" or "Opens in". Default "Starts in". |
| `after_label` | optional | The headline after it ends. With `next_start` it counts down to it (default "Starts in"); without, it counts up from the end (default "Ended"). |
| `start_label`, `end_label` | optional | Words before the start's and end's times under the bar, up to 24 characters each, like "Sunrise" and "Sunset". |
| `detail` | optional | A line under the bar, up to 120 characters. |

Full width. The track is a quiet grey, the window on it a pale chart colour, the part already gone the chart colour itself, and now a white knob, with the start and end times under their places. A window that crosses midnight shows at both ends of the bar. Above it, the time left counts down on its own. From a weather source, map sunrise and sunset straight in: OpenWeather's One Call answer has `daily[0].sunrise`, `daily[0].sunset` and `daily[1].sunrise`.

```json
{ "id": "daylight", "type": "window", "label": "Daylight left", "before_label": "Until sunrise", "after_label": "Until sunrise",
  "start": "2027-03-12T06:34:00-06:00", "end": "2027-03-12T18:17:00-06:00", "next_start": "2027-03-13T06:32:00-06:00",
  "start_label": "Sunrise", "end_label": "Sunset" }
```

## agenda

[See examples](https://legatobar.com/features#card-agenda)

Dated items over one day, a week or up to 30 days: meetings, an itinerary, an on-call rota, release windows, bills due.

| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `days` | optional | 1–30, default 1: how many days the card shows, starting today in the Mac's time zone. Past a week, `hide_empty_days` keeps it short. |
| `hide_empty_days` | optional | `true` leaves out the days with nothing on them, instead of saying "Nothing scheduled" under each. When no day has anything, the card says it once. Default `false`. |
| `max_events` | optional | List no more than this many events, with **Show *N* more** under them for the rest. Today's events already over don't count and are left out until it's pressed, so the first events listed are still to come. |
| `hide_all_day_label` | optional | `true` leaves "All day" off all-day items, for a card where every item is a date, like bills due. When no item has a time, the time column goes too. Default `false`. |
| `items` | required | Up to 60 items, in any order. An empty list is allowed and shows "Nothing scheduled". |

Each item:

| Field | | |
| --- | --- | --- |
| `title` | required | 1–80 characters. |
| `start` | required | Either a date-time with seconds and a zone, like `countdown`'s `at` (`2027-03-12T09:30:00-06:00`), or a date, `2027-03-12`, for an all-day item. |
| `end` | optional | The same form as `start`, and not before it. A date `end` is the **last day**, inclusive: an offsite on the 12th and 13th is `"start": "2027-03-12", "end": "2027-03-13"` (not the 14th, as iCalendar would have it). |
| `detail` | optional | Up to 120 characters, on a line under the title: the room, the gate. |
| `url` | optional | An https link, or [another page](https://legatobar.com/docs/card-fields.md#links-to-other-pages). The button says **Join** from ten minutes before a timed item until it ends, and **Open** otherwise. |
| `state` | optional | `ok`, `warning`, `critical` or `unknown`, drawn as a coloured mark on the row. It doesn't count toward the page's status. |
| `color` | optional | `#RRGGBB`, such as a calendar's colour. It's drawn only as a thin bar at the row's leading edge, never as text or a fill, so any colour reads in light and dark mode. Anything else, like `blue` or `#123`, is an error. |
| `icon` | optional | An [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the title. |

Full width. The Mac groups items by day in its **current** time zone, under Today, Tomorrow and then the weekday, with all-day items first and timed ones by start time. An item that covers several days appears on each. Days in the window with nothing on them say "Nothing scheduled", so the card keeps its height (or are left out with `hide_empty_days`), and items outside the window are left out: write a week once and the card moves on a day at midnight by itself.

Today's past items are dimmed, a thin line marks now, and the item in progress shows "until 10:45". All of that keeps up on the Mac's own clock, with no write needed. An all-day item is a date, not a moment, so it stays on its day wherever the Mac is; a timed item written in another zone also shows its own time ("9:00 AM GMT+9"), so an itinerary written in one zone still reads right in another.

```json
{ "id": "schedule", "type": "agenda", "label": "Schedule", "days": 2, "items": [
  { "title": "Release freeze", "start": "2027-03-12", "end": "2027-03-14", "color": "#E8710A" },
  { "title": "Design review", "start": "2027-03-12T09:50:00-06:00", "end": "2027-03-12T10:45:00-06:00",
    "detail": "Room 4", "url": "https://meet.example.com/design" },
  { "title": "Flight UA 512", "start": "2027-03-13T07:05:00-06:00", "detail": "ORD → SFO, gate B12", "state": "warning" } ] }
```

## month

[See examples](https://legatobar.com/features#card-month)

This month as a grid, with the chosen day's items under it.

| Field | | |
| --- | --- | --- |
| `label` | optional | |
| `items` | required | Up to 300 items in the [agenda](https://legatobar.com/docs/card-time.md#agenda)'s form, in any order. An empty list is allowed. |
| `days` | optional | 1–30, default 1: how many days the list under the grid shows, from the chosen day, as an [agenda](https://legatobar.com/docs/card-time.md#agenda)'s `days` does. With `30`, the next month at a glance under the grid. |
| `hide_empty_days` | optional | With `days`, `true` leaves out the days with nothing on them, instead of saying "Nothing scheduled" under each. When no day has anything, the card says it once. Default `false`. |
| `max_events` | optional | List no more than this many events under the grid, with **Show *N* more** for the rest, as an [agenda](https://legatobar.com/docs/card-time.md#agenda)'s `max_events` does. The grid's dots still show every item. With `"days": 30, "max_events": 20`, the next 20 events and the rest a click away. |

Full width. The grid shows six weeks from the week of the 1st, in the Mac's current time zone and starting on its first day of the week, so the card keeps its height and the last days reach into next month. Today is filled with the accent colour. A day with items gets up to three dots, one per `color` (grey for items without one).

Today is chosen until someone clicks another day, and the chosen day's items are listed under the grid as the agenda lists them: all-day items first, a line at now, **Join** and **Open**. With `days`, the list runs on from the chosen day for that many days, each under its own heading. The same items fill either card, so a page can switch between `agenda` and `month` by changing `type`. Each day of the month moves on at midnight by itself; on the 1st the grid turns to the new month.

The arrows beside the month's name page up to 12 months either way, and **Today** comes back; the panel opens on this month each time. A card shows the items written for whichever month it's on, so include the months you want someone to be able to page to, within the 300 items. A [calendar source](https://legatobar.com/docs/source-calendar.md#calendar-sources) reads each month as it's shown, and 30 days past it for the list.

```json
{ "id": "month", "type": "month", "items": [
  { "title": "Release freeze", "start": "2027-03-12", "end": "2027-03-14", "color": "#E8710A" },
  { "title": "Design review", "start": "2027-03-12T09:50:00-06:00", "end": "2027-03-12T10:45:00-06:00",
    "detail": "Room 4", "url": "https://meet.example.com/design", "color": "#1A73E8" },
  { "title": "Offsite", "start": "2027-03-17", "end": "2027-03-18", "detail": "Lake house", "color": "#E8710A" } ] }
```

## timeline

[See examples](https://legatobar.com/features#card-timeline)

A dated history, newest first: a package's tracking events, a job's runs, an order's steps. It's drawn as an [agenda](https://legatobar.com/docs/card-time.md#agenda) is, under day headings with a time column, and a rail of nodes beside the times. The newest event is the current one, with a filled node.

| Field | | |
| --- | --- | --- |
| `label` | optional | Left out, the card has no title row, as a [checklist](https://legatobar.com/docs/card-lists.md#checklist)'s. |
| `items` | required | Up to 60 events (below). When Legato can read every one's `at`, it sorts them newest first itself; otherwise they stay in the order sent, which should be newest first. An empty list is allowed and says "No events yet". |
| `next` | optional | What the source expects next, such as a delivery window: `{ "title", "start", "end", "detail" }`, with `start` and `end` in the forms `at` takes. It's drawn above the newest event, a hollow node on a dashed rail, never as an event. Without a `start` Legato can read there's no row, so a source can map an expected date that's sometimes missing. A date alone leaves the time column empty, and `end` on the same day reads "2 – 6 PM". Once the window is over it's dimmed; Legato doesn't call it late. |
| `max_items` | optional | Show the newest so many events, with **Show *N* more** for the rest. The newest always shows; `next` and quiet spells don't count. |
| `gap_days` | optional | 1–30. When two shown events are this many days apart or more, a grey "No updates for 3 days" sits between them on a dashed stretch of rail, and above the newest when it's that old. It keeps up with the Mac's clock. A package page uses 2. |

Each item:

| Field | | |
| --- | --- | --- |
| `title` | required | 1–80 characters, the event in the source's own words: Out for delivery, Arrived at facility. |
| `at` | required | When it happened: ISO 8601, a date (`2026-11-04`, drawn with no time), a date and time with no zone (`2026-11-04 14:30:00`, read as the Mac's time), Unix seconds, or a carrier's own words, such as `Monday, November 2, 2026 3:14 PM`, `November 2, 2026 03:14 PM EST` or `02.11.2026 14:30`. Words with no zone are read on the Mac's clock, so the time shows as the carrier wrote it. A time Legato can't read is shown as written on the detail line, under the day before it. |
| `detail` | optional | Up to 120 characters on the line under the title: where it happened. |
| `state` | optional | `warning`, `critical` or `unknown` draws that mark on the rail in place of the node, for an exception or a failed delivery attempt; `ok` and `off` are the plain node. Like an agenda item's, it doesn't count toward the page's status: a `status` card says how the whole thing stands. |
| `icon` | optional | An [item icon](https://legatobar.com/docs/card-fields.md#item-icons) before the title. |

Full width. Days are headed Today, Yesterday, then "Wednesday, Nov 4" (with the year when it isn't this one), in the Mac's current time zone. Each title and detail is one line, cut short with the whole text as its tooltip, so no row grows. There's no progress ring, percentage or row for a step that hasn't happened: a history says what happened, and only `next` looks ahead. VoiceOver reads each row whole ("Out for delivery, Beaverton, OR, today at 8:12 AM, latest"; "Weather delay, Hodgkins, IL, yesterday at 6:02 AM, needs attention"), and the days as headings.

```json
{ "id": "tracking", "type": "timeline", "label": "Tracking", "max_items": 6, "gap_days": 2,
  "next": { "title": "Expected delivery", "start": "2027-03-12T14:00:00-06:00", "end": "2027-03-12T18:00:00-06:00" },
  "items": [
    { "title": "Out for delivery", "at": "2027-03-12T08:12:00-06:00", "detail": "Beaverton, OR" },
    { "title": "Weather delay", "at": "2027-03-11T06:02:00-06:00", "detail": "Hodgkins, IL", "state": "warning" },
    { "title": "Departed from facility", "at": "2027-03-07T16:20:00-08:00", "detail": "Ontario, CA" } ] }
```

Filled from [Parcel](https://parcelapp.net/help/api-view-deliveries.html) on a [page for every package](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item): the delivery whose tracking number the link names, its events, the newest marked when Parcel reports a failed attempt (6) or an exception (7), and its expected window as `next`. Parcel passes each carrier's own times through, in whatever words the carrier uses, and the card reads them:

```json
"derive": [ { "name": "this", "value": { "each": "recent.deliveries", "where": { "path": "tracking_number", "equals": "{param.tracking}" },
  "fields": { "events": "events", "code": "status_code", "expected": "date_expected", "expected_end": "date_expected_end" } } } ]

"source": { "ref": "parcel", "map": {
  "items": { "each": "this[0].events", "limit": 60, "fields": { "title": "event", "at": "date", "detail": "location" } },
  "items[0].state": { "path": "this[0].code", "values": { "6": "warning", "7": "warning" } },
  "next.title": { "template": "Expected delivery" },
  "next.start": "this[0].expected",
  "next.end": "this[0].expected_end" } }
```

## strip

[See examples](https://legatobar.com/features#card-strip)

An item's states over a span, one thin bar per slice, coloured by the state it was in: a monitor's last day, a host's week, a container's month. It's drawn from [samples History keeps](https://legatobar.com/docs/history-collect.md#samples), and it says what happened, not how things stand now.

| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title, like "Last 24 hours". |
| `segments` | required | Up to 240 slices, oldest first, each `{ "state", "label" }`. An empty list draws an empty track. |
| `start_label`, `end_label` | optional | Up to 40 characters under each end: "24 hours ago" and "Now". |
| `detail` | optional | Up to 40 characters beside the title: what the span adds up to, like "99.2% up". |

Each segment's `state` is `ok`, `warning`, `critical`, `unknown` or `off`, as a [status](https://legatobar.com/docs/card-lists.md#status) card has them, or `none` for a slice with no data, drawn as the empty track. Words that aren't a state are `unknown`; a segment without one is `none`. `label`, up to 80 characters, is what the segment says when the pointer is over it: "3 PM · down 12 min".

Full width, 18 points high. With room, bars have a 1-point gap; past about 100 segments on a panel they touch. The segment under the pointer is marked, and its label and state take the place of the two end labels on the same line, so the card doesn't grow or move; they come back when the pointer leaves. VoiceOver reads the title and how many slices were in each state ("Last 24 hours; 2 critical, 94 OK; 99.2% up"), and steps through the segments one by one with increment and decrement.

A strip is history, not status: it never counts toward the page's status, a section's dot or a notification, whatever its segments say. Put a `status` card beside it for how the item stands now.

```json
{ "id": "history", "type": "strip", "label": "Last 24 hours", "detail": "99.2% up",
  "start_label": "24 hours ago", "end_label": "Now",
  "segments": [ { "state": "ok", "label": "2 PM" }, { "state": "critical", "label": "3 PM · down 12 min" },
                { "state": "none", "label": "4 PM" } ] }
```

Filled from an item's samples on a [page for every item](https://legatobar.com/docs/detail-pages.md#one-page-for-every-item), with [`by_time`](https://legatobar.com/docs/mapping-expiry.md#slices-of-time) cutting the span into equal slices and [`worst`](https://legatobar.com/docs/mapping-expiry.md#slices-of-time) giving each one the worst state in it. Without `buckets`, `by_time` makes 144 slices, ten minutes each of a day:

```json
"sources": { "samples": { "dataset": "kuma-samples", "key": "{param.id}",
  "derive": [ { "name": "up", "value": { "multiply": [ { "divide": [
      { "count": "kept.rows", "where": { "path": "row.state", "equals": "ok" } }, { "count": "kept.rows" } ] }, 100 ], "round": 1 } } ] } }

"source": { "ref": "samples", "map": {
  "segments": { "each": "kept.rows", "by_time": { "at": "at", "span": "kept.span" },
                "fields": { "state": { "worst": "row.state", "of": "rows" }, "label": { "template": "{from|time}" } } },
  "detail": { "template": "{up}% up" } } }
```

## heatmap

[See examples](https://legatobar.com/features#card-heatmap)

A square per day, in week columns, each shaded by how much happened that day: a year of GitHub contributions, of steps, of tasks done. Weeks run left to right, oldest first, and days top to bottom, Sunday at the top, as GitHub draws its calendar. It says what happened, not how things stand now.

| Field | | |
| --- | --- | --- |
| `label` | optional | The card's title, like "Contributions". |
| `detail` | optional | Up to 40 characters beside the title: what the span adds up to, like "1,194 in the past year". The page works it out; the card doesn't. |
| `items` | required | Up to 371 days, each `{ "date", "value", "level", "label", "url" }`. An empty list says "No data". |
| `thresholds` | optional | 4 ascending numbers where levels 1 to 4 start, for an absolute scale. |

- **`date`** is a day, `YYYY-MM-DD`, placed as written: Legato never turns it into a moment, so no time zone can move it. A date with a time after it (`2026-11-08T00:00:00Z`) counts as its date part. The first date to the last span at most 371 days, and the grid runs from the first to the last: to end at today, include today's item. If two items have the same date, the last one wins, so group rows by date first.
- **`value`** is how much happened, and **`level`** is the shade, a whole number from 0 to 4. A given `level` wins. Without one, `thresholds` place the value: `[1, 2500, 5000, 10000]` makes 0 steps level 0, 3,000 level 2 and 12,000 level 4. Without thresholds, 0 and below are level 0 and the rest fall in the quartiles of every value above 0, as GitHub's own calendar does; with only a few values, the top levels may go unused.
- **A missing day is not a zero.** A date between the first and the last with no item, or an item with neither `value` nor `level`, is drawn as an empty outline: no data. A measured 0 is a grey square. A page whose service leaves out days that really were zero gives those days `"value": 0`.
- **`label`**, up to 80 characters, is what the day says under the pointer: "3 contributions on Nov 9". Without one, the date and value ("Nov 9, 2025 · 3").
- **`url`**, https or another page, is what a click on the day opens.

Full width. The squares fill the card's width, about 53 columns of 6 points in the panel, up to 14 points for a span of a few weeks; that's 7 rows, about 46 points high for a year. The month names sit over the first column of each month, and Less … More under the grid shows the five shades: grey for 0, then the theme's chart colour stronger for each level. The day under the pointer is outlined and its label takes the legend's place on the same line, so the card doesn't grow or move; the legend comes back when the pointer leaves. VoiceOver reads the title and the detail (or how many days have data, and their total), and steps through the days one by one with increment and decrement, saying "No data" for a missing one; a day with a link can be opened from there.

A heatmap is history, not status: it never counts toward the page's status, a section's dot or a notification.

```json
{ "id": "steps", "type": "heatmap", "label": "Steps", "detail": "8,412 a day",
  "thresholds": [1, 2500, 5000, 10000],
  "items": [ { "date": "2026-11-01", "value": 0 }, { "date": "2026-11-02", "value": 3100 },
             { "date": "2026-11-04", "value": 12500, "label": "12,500 steps on Nov 4" } ] }
```

GitHub's contribution calendar is a list of weeks, each with its days: [`flatten`](https://legatobar.com/docs/mapping-tables.md#turning-a-table-round) turns it into one list of days. Map `contributionLevel` to `level`, not its `color`, so the card draws in Legato's shades in light and dark. `last` keeps a longer answer to the newest 371 days:

```json
"source": { "ref": "calendar", "map": {
  "items": { "each": "data.viewer.contributionsCollection.contributionCalendar.weeks", "flatten": "contributionDays", "last": 371,
    "fields": { "date": "date", "value": "contributionCount",
      "level": { "path": "contributionLevel", "values": { "NONE": 0, "FIRST_QUARTILE": 1, "SECOND_QUARTILE": 2, "THIRD_QUARTILE": 3, "FOURTH_QUARTILE": 4 } } } },
  "detail": { "template": "{data.viewer.contributionsCollection.contributionCalendar.totalContributions} in the past year" } } }
```

A [History](https://legatobar.com/docs/history.md) dataset dated by day gives a day per group: `{ "each": "kept.rows", "group": "date", "fields": { "date": "key", "value": { "count": "rows" } } }`.

