A custom card is one JavaScript file: card({...}) at its top, and a function draw under it. This page lists everything the card can use. Write a custom card shows how to make one.
A part with an attribute it does not take, or a value out of its range, is drawn as a small note in its place saying what it takes. The rest of the card still draws.
What the card says of itself
In card({...}) | What it is |
|---|---|
name | The card's name. |
slots | What it reads: { name: { needs: { need: "kind" } } }. Kinds: text, number, checkbox, select, multi-select, date, relation, person, attachment. No need is called row or title. |
edits | The properties its controls and buttons may change, as "slot.need". |
adds | The slots it may add rows to, with a form. |
state | Its own state and starting values, kept on this device only. |
settings | Values a person changes in the card's Settings…: a value alone, or { value, label, choices, min, max, step, suffix }. Fewer than 20. |
A name starts with a letter and has up to 40 letters, digits or underscores. A state value is a value (words, a number, true, false or null), or a list or an object of them two levels deep. A card keeps at most 4,000 characters of state.
What draw is given
| Name | What it is |
|---|---|
| each slot by its name | Its rows, in the slot's sort. A row has row (its handle), title and each need. |
width | The card's inside width in pixels, at least 120. |
height | The card's inside height, where its height is chosen in its menu; otherwise null. |
selected | For each slot, the handle of the row selected on the page, or null. |
state, settings | The card's own state, and its settings' values. |
draft | What is filled in of a form, by slot. |
may | For each slot, what you may do with its rows: { edit, add, comment, trash }, and a row's own where its folder lets you do otherwise. A control you can't use is drawn quieter, its tip saying why. |
me | Who is looking at the card, { account, name }, or null for a public link's visitor. It decides what the card draws, not who may change a row. |
pointer | Where the pointer is over a shape that asked for it, or null. |
gesture | A gesture a shape claimed with gestures: ["long", "right", "double", "swipe", "pinch", "wheel"], told once: its kind, where it was, and a swipe's distance and speed, a pinch's scale and turn, the wheel's distance. The wheel is heard only once you click into the shape; swipe and pinch keep the page from scrolling across it. |
keypress | On a shape with keys: true: what a fresh press of each key does, as a button's press, such as { Delete: trash(row) }. A held key's repeat never writes. |
keys | While you have clicked into a shape with keys: true: the key just pressed (key, repeat while held), the key let go (up) and every key held (held); null once you leave it. Ctrl, ⌘, Alt and Tab stay the app's, and Escape leaves the shape. |
frame, timer | Set in a drawing the card asked for: frame is { t, dt } in milliseconds, timer is true. |
touch, today | Whether the device is touched rather than pointed at, and today as "2026-11-27". |
lessMotion | Whether the person asks for less motion: then no frame and no loop plays. |
more | For a slot of over 2,000 rows, its total. Only the first 2,000 are given. |
A need written "number of boat" is read through the slot's boat relation: the card is given a list, the number on each row the relation links to, at most 10, in its order. In the card's Settings… it is matched to a property of the library the relation links to, or to its rows' titles. It is read only.
Values by kind: a date is { start, end } with end null for one day, a relation is a list of row handles, a person is a list of names, an attachment is a list of picture handles, and empty is null (false for a checkbox, [] for a list).
Layout
column(children, attributes), row(children, attributes), box(children, attributes), grid(children, attributes) and gap({ width }) or gap({ height }).
| Attribute | What it does |
|---|---|
gap | Space between children, 0 to 60. |
pad | Space inside, one number or [down, across], 0 to 60. |
align | start, center, end, stretch, or between to spread children along a row or column. |
width, height, min, grow | A size in pixels; height and min are least sizes; grow shares spare room. |
fill, edge, dash, radius | A colour inside, a 1.5 px edge (dashed with dash: true), round corners. |
wrap | Lets a row's children go on to the next line. |
stack | On a row: a column below this width, as row([...], { stack: 480 }). |
cols, least | On a grid: a number of columns, or as many as fit at least this wide. |
press, on, dim, tip, key | What a press does, shown as on, faded, its tip on hover, and its key. |
drag, drop | drag: take(row), or take([rows]) for up to 50 rows, and drop: drop("need", value); a list of drops, such as [drop("who", "Ben"), drop("day", "2026-12-01")], sets several properties at once, all or none. |
Words and pictures
text(words, attributes) takes role (title, figure, meta or body: the app's own styles), size (12 to 96), bold, italic, strike, color, face (words, interface or figures), align, lines (cuts it after so many lines), width, grow, press, tip and key. A size or colour named beside a role wins over it.
picture(handle, { width, height, radius, whole }) draws a picture from an attachment. whole: true shows all of it; otherwise it fills its box.
Numbers and days in the app's way: figure(1234.5) is 1,234.5, money(1250) is $1,250 ({ currency: "EUR", decimals }), percent(42) is 42%, and day(date) is Nov 27, 2026 ({ year: false, weekday: true }).
Drawings
shape({ width, height }, marks) is a drawing. Its marks are in pixels from its top left, drawn in their order, the last on top.
| Mark | What it draws |
|---|---|
line(x1, y1, x2, y2) | A straight line. |
rect(x, y, w, h) | A rectangle; radius rounds it. |
circle(x, y, r) | A circle. |
curve(x1, y1, x2, y2) | An S from the left point to the right one. |
path(points) or path("M0 0 L10 10 Z") | Points [[x, y], …] with closed, or SVG path data with the commands M L H V C S Q T A Z. |
label(x, y, words) | Words at a point, y at their baseline, at most 200 characters; size (12 to 96), bold, align, face, color. A label does not wrap. |
bitmap(x, y, cols, rows, px, { palette, w, h }) | Pixels, up to 512 across and 256 down: px has one character a pixel, row by row, 0 to f for a colour of palette (up to 16 of the app's colours) or . for none. With ramp: [from, to] in place of a palette, each cell is two characters, 00 to ff, shaded between the two colours: a heat map. Drawn as w by h, without smoothing, in the theme's colours. Keyed, it tells a shape's pointer which cell is under it, and its tip can say {col}, {row} and {value}. |
group(marks, { x, y, rotate, scale, clip, grip }) | Marks moved to a point, turned and scaled together (their line widths too), about their own 0, 0. clip shows only what falls inside a window in the group's units: { x, y, w, h, radius }, { x, y, r } or path data. With grip, slid as one. |
A mark takes color (its line), fill, weight, dash (true for a dashed line), dim (its opacity, 0 to 1), press, tip, key and through (drawn, but a press or tip below it is reached). A rectangle or circle with neither fill nor color is filled with ink. A shape hides what its marks draw past its edge.
Chart helpers
| Helper | What it gives |
|---|---|
chart.scale([lo, hi], [from, to], { nice }) | A function from a value to a place, with .ticks(n) and .invert(place). |
chart.band(keys, [from, to], { gap }) | A function from a key to where its bar starts, and .width. |
chart.ticks(lo, hi, n), chart.extent(list) | About n round values; the least and most of a list. |
chart.pie(values, { gap }) | Slices, each { value, from, to } in degrees. |
chart.arc(x, y, r, from, to, { inner }) | Path data for a slice, or for a piece of a ring. |
chart.line(points), chart.smooth(points) | Path data for a straight line, or a smooth one that never overshoots its points. |
chart.area(points, base, { smooth }) | Path data for the ground under a line. |
chart.stack(rows, keys) | For each key, each row's [from, to], stacked. |
chart.treemap(items, w, h) | A rectangle for each item, sized by its value. |
chart.polar(x, y, r, degrees) | A point at a distance and an angle. |
Angles are degrees, 0 at the top, going clockwise.
Colours and faces
Colours: ink, ink-2, ink-3 (words, fainter, faintest), line, line-2, page, raised (edges and paper), red, orange, yellow, green, blue, purple, the light tag-red to tag-purple behind words, on-ink (words on an ink fill), danger and none. mix("blue", "page", 0.3) is blue with three tenths of the page in it. Every colour follows the app's light and dark themes.
Faces: words (a serif, for titles and people's own words), interface (the default) and figures (for numbers and dates).
Controls
The app draws and runs each control. Each takes label, key, width and disabled.
| Control | What it is |
|---|---|
stepper({ step, min, max, prefix, suffix }) | A number with − and +. |
number({ hint, prefix, suffix }) | A number typed in. |
input({ hint }) | Words typed in. |
choice([options]) | Buttons for a few choices, up to 30; an option is words, or { label, value }. |
check() | A checkbox. |
slider({ min, max, step }) | A slider. |
button("Words", { press, strong }) | A button. |
A control is bound with bind: edits(row, "need") changes a property of that row, keeps("name") the card's own state, and fills("slot", "need") a new row's form.
Presses
| Press | What it does |
|---|---|
select(row) | Selects the row for the whole page; again clears it. |
open(row) | Opens the row's note beside the page. |
set({ name: value }) | Changes the card's own state. |
edit(row, "need", value) | Sets one property of one row. Only on a button. |
[edit(…), edit(…)] | On a button: 2 to 20 edits made together, or none of them. One that cannot be made refuses the whole press. |
save("slot", { name: value }) | Adds a row to the slot's library from its form. Only on a button. |
Marks a person slides
grip: slide(bind, how) on a mark, or on a group to slide everything it draws as one, lets a person slide it to set a value. how takes a label, and either along: [[x, y], …] with from, to and step for a number along a line, or stops: [{ x, y, value }, …] for places. While it moves, held(row, "need") is where it is under the finger. The value is written once, when it is let go. A mark inside a group cannot be slid on its own: slide the group.
Motion
| Attribute | What it does |
|---|---|
hover: { fill, edge, color, dim, lift, grow } | What changes while the pointer is over a part; grow is 0.8 to 1.25. Only on a device with a pointer. |
enter: "fade", "grow", "rise" or "extend" | How a part comes in the first time it is drawn; or { kind, ms, delay }, each up to 3,000 ms. |
loop: "pulse", "spin" or "breathe" | Over and over; or { kind, ms }, a round 400 to 60,000 ms. Never on a part that holds a control. |
move: false or a time in ms | A part with a key moves from one drawing to the next, a group's turn and scale too; move keeps it still or times it, up to 3,000 ms. |
None of it plays where the person asks for less motion.
The pointer
shape({ width, height, pointer: "hover" or "drag", key, label }) is told where the pointer is: pointer is { at, x, y, down, from, up } in the shape's own units, with up true in the one drawing where it is let go. A drag shape holds the finger, so the page does not scroll under it. The arrow keys move the point, and Enter taps. A shape told the pointer takes no press.
Remember, timers and frames
| Call | What it does |
|---|---|
remember({ name: value }) | Keeps values in the card's own state, in a drawing for the pointer let go, a key, a frame or a timer. |
again(ms) | Draws the card again after that long, at least 100 ms (a second for less motion). |
again("frame") | Draws the card again at the next frame, at most 30 a second. |
Each again is for the next drawing only: ask again in each drawing to go on. Frames stop while the card is off screen, where the person asks for less motion, and when they draw too slowly, until the person next uses the card.
Limits
A drawing has at most 2,500 parts, nested at most 24 deep. draw has 1.5 seconds. The language is modern JavaScript with its own built-ins, such as Array, Object, Math, Date, JSON, Map, Set, RegExp and Promise, and newer methods such as Object.groupBy. There is no Intl, no console, no setTimeout (use again), no network and no page. Nothing a card draws loads anything: a web address in a row is shown as words.