Skip to content

The card file

Bindings and formatters

Show live values with $bindings, and format them at display time.

A string that starts with $ is a binding: it shows a live value, and the card redraws when the value changes. Inside other text, {$…} fills a value in. Pipes format a value at display time, so state always holds the raw number, time or list.

{ "stat": "$deploys.0.status | upper" }
{ "text": "Updated {$meta.deploys.updated | ago}" }
{ "badge": "$site.status | tone:{good:'<400', else:'bad'} | map:{good:'Up', else:'Down'}" }

Write {{ for a literal {, and start with $$ for a literal $.

What you can bind to

$<state key>A declared state key, or a source's key
$settings.<key>A setting value
$item, $indexThe current element and its position, inside list 'item', table 'columns' and checklist templates
$args.<name>An action's arg (declared in its 'args'); on_change actions get $args.value and $args.previous; gallery on_select actions get $args.item
$<as name>The result of an earlier step in the same action
$meta.<source>.updated|error|statusUnix time of the last good run, the last error message, or 'idle' | 'running' | 'ok' | 'error'
$running.<action>true while that action runs (use for 'disabled')
$job.<action>a job action's { status, progress, done, total, started, ended, error }
$nowCurrent unix time in seconds. A card that shows it redraws each minute (each second with time:…:'seconds', duration or ago)
$ui.<name>show_ui only: values from fields and checklists

Paths, pipes and templates

PathsDotted; numeric segments index arrays: $deploys.0.status. A missing path is null.
Pipes$value | name or $value | name:arg1:arg2. Args: numbers, 'single-quoted text', true, false, null, or {key:'value', other:2} (keys unquoted or single-quoted). add, times, pick, currency, time, offset, hour and default also take a $binding with no formatters: time:$item.tz.
TemplatesValues interpolate as plain text (null → empty). Use a formatter for display: {$x | number}.
True and falseFor when, if and disabled: null, false, 0, "" and empty lists are false.

Formatters

number · compact · currency · percent · delta · duration · ago · until · date · bytes · truncate · upper · lower · map · tone · default · hue · count · add · time · offset · hour · zone · flag · url · where · share · times · pick · encode · decode · hash · seconds · sum · avg · min · max · sort · limit · pluck · unique · join · split · round

Locale number with grouping

$visits | number  →  18,234
args decimals (optional)

Short number

$visits | compact  →  18.2k

Money in major units (dollars, not cents); 0 decimals unless 'full'

$mrr | currency:'EUR'  →  €4,820
args ISO code or $binding (default 'USD'), 'full' for 2 decimals

0.062 → 6.2%

$churn | percent  →  6.2%
args decimals (default 1)

Signed change with an arrow

$change | delta  →  ▲ 6.2%
args decimals (default 1)

Seconds → largest two units; 'signed' puts + before a positive one; 'clock' gives 4:30 or 01:30:00

$uptime | duration  →  1m 12s
args 'signed' | 'clock' (optional)

Unix seconds (or ms), or ISO 8601 text → relative time

$item.created_at | ago  →  4 min. ago

Time left until a time; live in a status label (0 → empty). In cards use timer

$ends_at | until  →  12:05
args 'clock' (default, 4:05) | 'short' (12m)

Timestamp → locale date; 'day' is weekday, month and day (Tue, Nov 24). A zone second gives the day it is there

$now | date:'day':$item.tz  →  Tue, Nov 24
args 'short' | 'medium' (default) | 'long' | 'day', zone: IANA name, 'local' or $binding (default: this device)

Byte count → size

$size | bytes  →  1.5 MB

Shorten with …

$item.commit_message | truncate:40  →  Fix the deploy…
args max characters (default 40)

Uppercase

$status | upper  →  LIVE

Lowercase

$status | lower  →  live

Value → mapped value. Keys match text, numbers (200), true, false or null; 'else' is the fallback; no match and no else keeps the value

$item.status | map:{finished:'Live', failed:'Failed', else:'Deploying'}  →  Live
args {key:'value', …, else:'…'}

Value → a tone. No arg: sign of a number (+ good, − bad, 0 neutral). Thresholds, checked in order: {good:'<300', warn:'<800', else:'bad'} (operators < <= > >= = !=; join with ' or ': '<7 or >=23'). Or a map to tones: {finished:'good', failed:'bad', else:'accent'}

$site.ms | tone:{good:'<300', warn:'<800', else:'bad'}  →  good
args optional object

null, "" or [] → the given text

$lastText | default:'Nothing yet'  →  Nothing yet
args text (default '—')

Value → a categorical colour name. No arg: a stable hue from the text, the same on every device. Or a map: {design:'pink', eng:'blue', else:'gray'}

$item.team | hue  →  teal
args optional object

Length of a list or text (null → 0)

{$ports | count} listening  →  3 listening

Number + a number or binding, e.g. a time shifted by a slider

$now | add:$shift  →  1763687580
args number or $binding

A time → time of day in a zone (device's 12/24 h style). Cards using it with $now tick by themselves

$now | time:$item.tz  →  16:13
args zone: IANA name, 'local' or $binding (default: this device), 'seconds' (optional)

A time → how far a zone is ahead of this device then (or of a second zone), DST included

$now | offset:$item.tz  →  -9h
args zone (required), from zone (optional)

A time → the hour of day in a zone as a number (16.25 = 16:15), for tone thresholds

$now | hour:$item.tz  →  16.25
args zone (default: this device)

A time → a zone's own name then: its short name in the card's locale (PST, BST, GMT+9; DST included), its city from the IANA name, or its long name. zone:'local':'city' is where this device is

$now | zone:$item.tz  →  GMT+9
args zone: IANA name, 'local' or $binding (default: this device), 'short' (default) | 'city' | 'name'

Two-letter country code → flag emoji (an icon takes it)

$item.country_code | flag  →  🇵🇱

Text made safe inside a URL (percent-encoded), for a fetch URL built from input

https://api.example.com/search?q={$args.value | url}  →  …?q=San%20Jos%C3%A9

The items of a list that pass: 'done' keeps items whose done is true; {done:false} keeps items whose fields equal these (true/false compare truthiness, so a missing done is false); 'id':$params.id keeps items whose field equals a value or binding (a detail card finding its item). Chain count to count them, pick:0 for the first

{$todos | where:{done:false} | count} left  →  3 left
args field name, or {field:value, …}, or a field name and a value or binding

The part of a list that passes (as where), 0…1: for a progress bar. An empty list is 0

$todos | share:'done'  →  0.6
args field name, or {field:value, …}, or a field name and a value or binding

Number × a number or binding, e.g. an exchange rate × the amount; null when the argument isn't a number

$rates.rates | pick:$to | times:$amount  →  92.43
args number or $binding

An object's field (or a list's element) named by the argument; missing → null

$rates.rates | pick:$to  →  0.924
args key text, list position or $binding

Text → Base64, URL-safe Base64, hex, or escaped for a Wi-Fi / vCard QR code (for URLs use url)

$input | encode:'base64'  →  aGk=
args 'base64' | 'base64url' | 'hex' | 'wifi' | 'vcard'

Base64 (either kind), hex or percent-encoded text (+ stays +) → text; null when it isn't valid, so add default

$input | decode:'base64' | default:'Not Base64'  →  hi
args 'base64' | 'hex' | 'url'

Digest of the text as lowercase hex (sha1 and md5 only for checksums)

$input | hash:'sha256'  →  8f43…
args 'sha256' (default) | 'sha1' | 'md5' | 'sha512'

Typed length → seconds: '4:30', '25' (minutes), '1h 30m', 'tea 10 min'; 'rest' gives the other words ('tea')

$entry | seconds  →  270
args 'rest' (optional)

Total of a list's numbers, or of one field of each item; non-numbers skipped, empty → 0

$expenses | sum:'amount' | currency  →  $1,240
args field (optional)

Mean of a list's numbers (or a field); none → null

$runs | avg:'ms' | round  →  182
args field (optional)

Smallest number in a list (or a field); none → null

$prices | min:'eur' | currency:'EUR'  →  €12
args field (optional)

Largest number in a list (or a field); none → null

$runs | max:'ms' | number  →  3,120
args field (optional)

Sorted list: numbers by value, text A–Z ignoring case, null last. '-' largest first; 'field' / '-field' sorts items by a field

$runs | sort:'-ms' | limit:5  →  the 5 slowest runs
args 'field', '-field' or '-' (optional)

First n items (negative: last n), or first n characters

$log | limit:-3  →  the last 3 entries
args whole number, not 0

List of objects → list of one field

$people | pluck:'name' | join  →  Anna, Ben, Cara
args field

List without repeats (the first of each kept)

$expenses | pluck:'category' | unique | join  →  Food, Travel

List → text with a separator (default ', '); null items skipped

$tags | join:' · '  →  work · home
args separator (optional)

Text → list of trimmed, non-empty pieces (default: split on line breaks)

$line | split:','  →  ["a", "b"]
args separator (optional)

Number rounded to n decimals (default 0); stays a number, so tone still works

$temp | round:1  →  21.4
args decimals (optional)