Cards

Shared fields and links

What every card accepts, how wide each type is, a table of all twenty-nine types, and how a card links to a website or another page.

A page's cards array sets the order from top to bottom. There are twenty-nine card types; 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.

TypeFor
statOne headline number: a balance, open PRs, uptime
pacingProgress against a target: budget pace, a sprint, a ring for today's steps
listUp to 60 short lines: largest charges, new deals
tableA small grid, up to 4 columns and 10 rows
sparklineA trend line of up to 240 points
statusThe health of one service or job
textA short note, up to 500 characters
linkA button that opens an https URL or another page
countdownTime until a moment: a flight boards, a domain renews
windowA window in the day: daylight left, opening hours, off-peak charging
mapPlaces on Apple's map: the car, a package, a trip's stops
factsA few labelled values: order number, carrier, ETA
gaugeA value in a range with coloured bands: CPU temperature, air quality
barsCategories with values: spend by category, votes
breakdownParts of one whole in one coloured bar: net worth by asset, a budget by category
flowWhere amounts go: DNS queries from each device to allowed and blocked, solar and grid to the house and the car
rangesRows from low to high on one scale: a week of temperatures, a price's daily range
columnsPeriods side by side, one to three series: income against spending by month
tilesSmall tiles four across, each a label, a value and a change, tinted by how far it moved: a watchlist
fleetA dot per host or job, up to 60
checklistUp to 20 items, done or not
agendaA day, a week or up to 30 days of meetings, trips, deadlines and bills, with a line at now
monthThis month as a grid with a dot on each busy day, and the chosen day's items
timelineA dated history newest first: a package's tracking, a job's runs, an order's steps
stripAn item's states over a span, a thin bar per slice: a monitor's last day
heatmapA square per day in week columns, shaded by how much: a year of contributions or steps
codeA block of code or a command, monospaced, with a Copy button
headingA section title that splits a long page into parts, which can open and close
tabsTwo to five tabs in one place, each with its own cards: several feeds, today and this week, one server each

The page 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, 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
idrequiredUnique within the page. 1–64 characters: lowercase letters, digits, - and _, starting with a letter or digit. Keep ids stable between writes.
typerequiredOne 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.

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 (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.

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 card, opens its section if a closed 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" } ] }

For help choosing the structure, see Page design, including 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, 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 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.

json
{ "key": "Resting", "value": "61 bpm", "icon": "heart", "color": "pink" }
iconDraws
creditcard, cart, fork.knifeThat SF Symbol, in grey.
si:chase, si:paypalA logo from Simple Icons, in the text's colour.
di:paypal, di:nocodbAn icon from Dashboard Icons: in the text's colour by default, or in its own colours with Show logos in one colour off.
mdi:cash, mdi:airplaneAn icon from Material Design Icons, in the text's colour.
site:citi.comThe 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 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 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.