AdanotchDocs
Guides

Design guide

Make your view look like it belongs on the island.

Your view is drawn by Adanotch with the same colours, type and spacing as the built-in modules. You don't style anything; you choose meaning: a tone, a text style, one primary button. This page is about choosing well.

Use a tone, not a colour

A tone is a meaning. Adanotch picks the shade, so your view follows the island if its colours change.

default

Temel metin ve simgeler

Örnek
secondary

Yardımcı metin ve etiketler

Örnek
accent

Vurgu, bağlantı, sayaç

Örnek
success

Tamamlanan, onaylanan

Örnek
warning

Uyarı, bekleyen durum

Örnek
danger

Kritik sınır, hata

Örnek
ToneSay it when
defaultNormal content. Leave it out.
secondarySupporting text: units, timestamps, hints.
accentThe one thing to look at.
successDone, connected, healthy.
warningNeeds attention soon.
dangerFailed, or about to lose something.

Pick a tone for what it means, not for how it looks. Someone who can't tell the colours apart still reads the word next to it.

ui.stack([
  ui.text("Disk"),
  ui.badge("92% full", { tone: "warning" }),
]);

The only colour you choose yourself is a swatch, for data that has its own colour (a tag, a team). It takes #RGB or #RRGGBB.

Text styles

StyleUse for
displayThe one big figure of a view: a clock, a temperature.
titleThe main line of the card.
bodyDefault. Leave it out.
captionMetadata, timestamps, hints.
monoCode, ids, output.

One display per view. If everything is big, nothing is.

ui.stack([
  ui.text("21°", { style: "display" }),
  ui.text("Clear · updated 3 min ago", { style: "caption", tone: "secondary" }),
]);

Badges

A short status or count beside a title: one or two words. A badge isn't tappable; use a button for that.

Badgesui.badge(text, { tone, live, filled })
ConnectedRecordingNew
ui.badge("Connected", { tone: "success" });
ui.badge("Recording", { tone: "danger", live: true }); // a pulsing dot: happening right now
ui.badge("New", { tone: "accent", filled: true });     // one badge that should stand out

dot adds a small dot, live makes it pulse, icon adds an SF Symbol, and filled fills it with the tone and dark text. Use live only while something is actually happening, and filled once per view. A sentence is not a badge. Put it in ui.text.

Buttons

primary marks the one main action of a view. Everything else is quieter. Two primaries compete, and the user can't tell which one is the default.

On the island the primary button is a cream pill with dark text. Cream is the island's colour for "on": the active tab, a switched-on toggle and the chosen segment use it too, so one primary stands out at a glance. The other buttons are pills as well: secondary on a faint white ground, outline and ghost in indigo text.

variantUse for
primaryThe one main action. Same as primary: true.
secondaryThe default: a second action beside the primary.
outlineA neutral action that shouldn't compete.
ghostA quiet action in a row or toolbar.
tintedA soft emphasis, e.g. a state that is on.
destructiveDelete, reset, disconnect. Ask first.

size: "small" is for buttons inside a row or an alert.

Buttonsui.button(label, action, { primary })
ui.stack([
  ui.button("Cancel", "cancel"),
  ui.button("Save", "save", { primary: true }),
], { axis: "h" });

Alerts

An alert is a message that belongs to the whole view: a module is off, a permission is missing, a sync failed. One title, at most one sentence, and at most one button.

Alertui.alert(title, { message, tone, variant, button })
Permission neededShortcuts don't work without Accessibility access.Synced just now
ui.alert("Permission needed", {
  message: "Shortcuts don't work without Accessibility access.",
  tone: "danger",
  variant: "tinted",
  button: { label: "Open", action: "open-settings" },
});
ui.alert("Synced just now", { tone: "success", variant: "ghost" });

tinted is the loudest, border the default, ghost the quietest. Use success, warning and danger for status; anything else reads as plain information. Don't use an alert for a value that changes every second: that's a ui.text or a badge.

Cards

A card groups related content on its own ground. Put the things that belong together in one card, and use a stack for the rest of the view.

Cardui.card(children, { variant, selected, action })
Today3 events
Go furtherOne highlighted card per view
ui.card(
  [ui.text("Today", { style: "title" }), ui.text("3 events", { style: "caption", tone: "secondary" })],
  { action: "open-today" }, // the whole card is a button
);
ui.card(
  [ui.text("Go further", { style: "title" }), ui.text("One highlighted card per view", { style: "caption" })],
  { variant: "brand" },
);

On the island a card is a dark ground with 22 pt corners and a hairline edge; brand is an indigo gradient and selected keeps the ground and draws a cream edge.

bordered is the default. Use brand for one card at most, tinted for something that has its own colour, and selected for the chosen card in a set. Don't nest a card inside a card.

Icon badges

ui.iconBadge puts a symbol on a tile: the leading mark of a row or a card. Use it instead of a bare ui.icon when the symbol should read as an object.

Icon badgesui.iconBadge(name, { tone, variant, size, round })
ui.iconBadge("bolt.fill", { tone: "accent", variant: "solid", size: "lg", round: true });
ui.iconBadge("bolt.fill", { tone: "success" });                       // tinted, md
ui.iconBadge("bolt.fill", { tone: "warning", variant: "border", size: "sm" });

Tabs, segments and fields

  • ui.tabs(tabs, { style: "underline" }) for views of the same content, "container" (the default) for a cream pill on a grey track.
  • ui.picker(action, value, options, { style: "segmented" }) when two to four short options should all be visible; the default is a drop-down.
  • ui.textField(action, { icon, hint, invalid }): icon says what the field is for, hint is a unit or a shortcut at the end, and invalid draws the edge in the danger colour. Say why it is invalid in a ui.text with tone: "danger" beside it.

Compact and expanded

The compact slot is the closed island: an icon, a short text, a badge, a timer or a gauge on each side of the notch. Keep each side to one small thing. Put detail in expanded.

Kapalı Adacompact.leading ve compact.trailing çentiğin iki yanında durur
34%
  • Show the number that matters in compact (ui.text("21°")), the story in expanded.
  • Don't repeat the same text on both sides of the notch.
  • A gauge or progress is a good compact node: it reads at a glance.

Icons

Use SF Symbols, never an image, for anything that isn't a picture of something: ui.icon("cloud.sun.fill"). They follow the text weight and the tone. Use ui.image only for a real picture (an avatar, a logo), and only from your network: hosts.

Before you ship

  • Every colour is a tone (or a swatch).
  • One display, at most.
  • One primary button per view, and one filled badge at most.
  • Badges are one or two words.
  • compact holds one small thing per side (alert, card and iconBadge can't go there).
  • Looks right with an empty state: no data yet, no network.

alert, card and iconBadge, and the new options on the other helpers, came with @adanotch/kit 0.2.0. Set adanotchVersion in your manifest to the Adanotch release that ships it before you use them.

See UI nodes for every helper and its options.

On this page