Skip to content

Get started

Your first card

Write a card by hand, check it and open it in TailApps.

This page builds a small card by hand: it checks a website every 30 seconds, shows the response time, turns red when the site is down, and sends a notification. You’ll need TailApps on your computer and a text editor.

The whole card

Save this as site-check.json. The sections below take it apart.

{
  "schema": "tailapps/v0",
  "app": "site-check",
  "name": "Site check",
  "description": "Checks example.com every 30 seconds and tells you when it goes down.",
  "icon": "globe",
  "permissions": ["net:example.com", "notify"],
  "sources": {
    "site": {
      "fetch": "https://example.com",
      "raw": true,
      "every": 30,
      "on_change": { "action": "changed", "watch": "$site.status | tone:{bad:'=0', good:'<400', else:'bad'}" }
    }
  },
  "cards": [{
    "id": "main",
    "layout": { "column": [
      { "row": [
        { "stat": "$site.ms | number", "label": "Response (ms)" },
        { "spacer": true },
        { "badge": "$site.status | tone:{bad:'=0', good:'<400', else:'bad'} | map:{good:'Up', else:'Down'}",
          "tone": "$site.status | tone:{bad:'=0', good:'<400', else:'bad'}" }
      ], "align": "center" },
      { "text": "HTTP {$site.status} · checked {$meta.site.updated | ago}", "size": "s", "emphasis": "subtle" },
      { "button": "Check now", "on": "check", "style": "plain" }
    ], "gap": "m" }
  }],
  "actions": {
    "check": { "steps": [{ "refresh": "site" }] },
    "changed": { "steps": [
      { "if": "$args.value | map:{bad:true, else:false}", "then": [
        { "notify": { "title": "example.com is down", "body": "HTTP {$site.status}" } }
      ] }
    ] }
  },
  "views": {
    "menubar": {
      "icon": "globe",
      "in_menu": "row",
      "label": "{$site.ms} ms",
      "label_tone": "$site.status | tone:{bad:'=0', good:'<400', else:'bad'}"
    }
  }
}

1. Who it is

schema is always tailapps/v0. app is the card’s id: kebab-case, 3 to 40 characters, unique on the device. name is what people see, and description is one line on the approval sheet. icon is an SF Symbols name.

2. What it may do

permissions lists everything the card does outside itself. net:example.com lets it reach that one host and notify lets it show notifications. The approval sheet shows them as “Connect to example.com” and “Show notifications”. Anything not listed is refused when it runs. All permissions

3. Where the values come from

A source fills the state key of the same name. This fetch source asks for the page every 30 seconds. With "raw": true it stores { status, ms } instead of the page itself, and status is 0 when the site can’t be reached. on_change runs the changed action whenever the watched value changes, here “good” or “bad”. Sources

4. What it shows

A card is a tree of parts. Each part is an object with one kind key whose value is the main value: { "stat": "$site.ms | number", "label": "Response (ms)" }. A string that starts with $ is a binding to state; inside other text, {$…} fills a value in. Pipes like | number, | ago and | tone:… format at display time, so state always holds raw values.

Parts and layout · Bindings and formatters

5. What it does

Actions are named lists of steps that run in order. check runs the source now; the button’s "on": "check" calls it. changed gets $args.value, the new watched value, and sends a notification when it’s “bad”. Actions and steps

6. Where it shows

views.menubar decides how the card sits in TailApps’ menu: "in_menu": "row" is one line that opens into the card, right for something you glance at. label is its status, which the person can also keep in the macOS menu bar and the Dock, and label_tone colours it. Where cards show

Check it

TailApps checks every card when it opens one, and names the path, the problem and the allowed values. You can also check a file from Terminal without installing it:

/Applications/TailApps.app/Contents/MacOS/tailapps-mcp validate site-check.json

For checks while you type, point your editor at the JSON Schema. In VS Code, add this to your settings (the card itself can’t carry a $schema key: unknown keys are errors):

"json.schemas": [
  { "fileMatch": ["*.tailapp.json", "cards/*.json"], "url": "https://api.tailapps.com/schema/tailapps-v0.json" }
]

The schema checks the shape

The JSON Schema catches unknown keys and wrong types. TailApps’ own check goes further: a missing permission, an action that doesn’t exist, a binding to a key that isn’t there. Always open the card once to see both.

Open it in TailApps

Next