leather-ui
Skill29 starsChanged 53 days agoMITView on GitHub
Build or change Leather UI in apps/extension, apps/web, apps/mobile, packages/ui or packages/features. Use when adding or editing a screen, sheet, row, card, button, toast, empty or loading state, or any styling, colour, text style or spacing. Covers which @leather.io/ui component to use, the token and ink-ladder specs, and how to check the result.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- feature-mapSkill
- fix-issueSkill
- leather-changelogSkill
- monorepo-navigationSkill
- new-issueSkill
- testing-patternsSkill
- triage-issueSkill
- write-extension-e2eSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Colour: Use semantic tokens only: ink.*, red.*, green.*, yellow.*, blue.*, orange.*.
- Very specific: line 50
If you're unsure, use ink.text-secondary.
- Very specific: line 52
Use exported Leather icons for UI symbols, including CheckmarkIcon for selection.
- Very specific: line 70
Spacing: Use space.01–space.11, which are 4, 8, 12, 16, 24, 32, 40, 48, 64, 72 and 128px.
- Very specific: line 71
Use them for padding, gaps and margins.
- Very specific: line 101
Don't use raw <button>, styled.button, radix-ui imports, or the extension's local tooltip.
- Distinctive: line 125
Keep UI copy concise enough to scan while leaving the information needed to decide visible:
- Very specific: line 130
Keep needed decision and safety context visible in ink.text-secondary.
- Distinctive: line 132
Never move required information into a tooltip to meet a sentence quota.
- Distinctive: line 133
Keep label hierarchy clear.
- Distinctive: line 138
After screenshotting, do a subtraction pass.
- Very specific: line 156
Run pnpm --filter @leather.io/<package> lint.
- Very specific: line 162
Look at it. For web or ui changes, render it in the web Playground (pnpm dev in apps/web, then /playground).
- Very specific: line 166
Check the ladder. Is every piece of supporting text that informs a decision in ink.text-secondary?
- Very specific: line 168
If you needed something that isn't in i-need-to.md, say so in the PR description.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Leather UI
Leather's UI comes from @leather.io/ui (web), @leather.io/ui/native (mobile) and
@leather.io/tokens. Prefer composing what exists over adding new markup. When this skill and
the code disagree, the code wins. Note the mismatch in the PR so it can be fixed here.
Where to look
docs/design/i-need-to.md: each job ("confirm a risky action", "show an address") mapped to one component, with a working snippet. Read the matching section before writing JSX.docs/design/never.md: the things lint rejects, and what to use instead.packages/tokens/README.md: the ink text ladder.packages/ui/src/exports.web.tsandpackages/ui/src/native.ts: everything the ui package exports.docs/design/recipes.md: page shells, rows, review sheet, amount, section header and inline info. Compose screens from these. Use typed page actions and notices; spacing belongs to the recipes. Variants are for consequential workflow or UX trade-offs, not cosmetic differences.docs/design/explore.md: the protocol for exploring a feature (today's flow first, recreated faithfully, then one coherent feature with its states for a fixed brief; alternatives only for consequential choices).apps/extension/AGENTS.md,apps/web/AGENTS.md: platform sizes, input and what to verify.
When no pattern fits, don't invent a one-off. Follow the escalation step in explore.md:
bring the missing pattern and a focused proposal to design, with alternatives only for
consequential choices. The answer becomes a recipe or a component.
Specs
Colour. Use semantic tokens only: ink.*, red.*, green.*, yellow.*, blue.*,
orange.*. Each one already switches between light and dark.
| Need | Token |
| Page background | ink.background-primary |
| Raised or grouped surface | ink.background-secondary |
| Component fill (inputs, chips) | ink.component-background-default |
| Hover / pressed fill | ink.component-background-hover / -pressed |
| Divider, border | ink.border-default (or border="default") |
| Error, warning, success, info | red, yellow, green, blue + .background-secondary |
Text colour: the ink ladder. Pick the step by how much the reader depends on the text:
ink.text-primary for the content itself, ink.text-secondary for text that informs a decision,
ink.text-subdued for metadata someone can skip (only on ink.background-primary), and
ink.text-non-interactive for disabled. The full rules are in packages/tokens/README.md.
If you're unsure, use ink.text-secondary. Don't use opacity to make an in-between shade.
An icon next to text matches the text's ink or is lighter, never darker: use InlineIcon.
Use exported Leather icons for UI symbols, including CheckmarkIcon for selection; never
substitute a font glyph.
Type. Web textStyle values are display.01–02, heading.01–05, label.01–03,
body.01–02, caption.01–02, code and address. Native Text variant uses the same names
without the dot (label01).
- Sheet titles:
heading.05 - Row titles:
label.01(useTitle) - Buttons and values:
label.02 - Captions:
caption.01(useCaption) - Addresses:
address. Mono (address,code) is for full addresses and code only, never an amount, total or fee (lintno-mono-amount; on web that includestabular-nums).
display.*, heading.02 and heading.03 are Marche and already uppercase. Don't set
textTransform yourself. Keep a small area (a row, a card, a review group) to about three text
styles; nested numbers and labels go a size smaller than their parent.
Spacing. Use space.01–space.11, which are 4, 8, 12, 16, 24, 32, 40, 48, 64, 72 and 128px.
Use them for padding, gaps and margins. Radii are xs, sm, md, lg and round. A page has
one horizontal gutter (space.05 in the popup): rows, inputs and header icon glyphs all sit on it.
Compositions. In the web Playground, build screens from the recipes in
docs/design/recipes.md. Page shells take typed actions and a notice, and the inline
ReviewSheet is a visual demo, so product code uses the real Sheet + SheetHeader. The
descriptor shapes and the Sheet footer are in docs/design/i-need-to.md ("Place the screen's
actions", "Open a focused task").
Components.
| Job | Web (@leather.io/ui) | Native (@leather.io/ui/native) |
| Action with a label | Button (solid once per view, then outline, ghost) | Button |
| Important action | labelled Button with an icon, never a bare + icon | Button |
| Text field | Input (floating label; see i-need-to.md for when) | Input |
| Icon-only action | IconButton + aria-label | IconButton + label |
| Clickable row or card | Pressable | Pressable |
| List row | ListItemBox or ItemLayout | Cell, ItemLayout |
| Focused task, confirm | Sheet + SheetHeader | Sheet (ref), WarningSheetLayout |
| Approve or sign | Approver | Approver |
| Problem that stays | Callout (edge to edge, top of its region) | Callout |
| Icon beside text | InlineIcon | — |
| Asset as the subject | its token icon: BtcAvatarIcon, StxAvatarIcon, … | same names |
| Short feedback | the app's useToast | useToastContext().displayToast |
| Loading | SkeletonLoader, Button aria-busy | SkeletonLoader |
| Address | AddressDisplayer, truncateMiddle | AddressDisplayer |
| Money | the app's Balance + formatCurrency | Balance |
| Tooltip | BasicTooltip | info sheet |
Don't use raw <button>, styled.button, radix-ui imports, or the extension's local tooltip.
Lint rejects all of them.
Example
A fee row on a review screen (web). The info icon sits inside the label, so it takes the label's line, size and ink:
<Flex justifyContent="space-between" alignItems="flex-start">
<styled.span textStyle="body.02" color="ink.text-secondary">
Sponsored fee
<BasicTooltip label="A sponsor pays this fee, so you need no STX for this transaction" asChild>
<InlineIcon icon={InfoCircleIcon} tone="subdued" placement="end" tabIndex={0} />
</BasicTooltip>
</styled.span>
<Balance balance={fee} formatCurrency={formatCurrency} textStyle="label.02" />
</Flex>A destructive confirm, and every other job: docs/design/i-need-to.md.
Copy and density
Keep UI copy concise enough to scan while leaving the information needed to decide visible:
- Title: 5 words or fewer. Buttons: 1–3 words, verb first ("Send", "Review", "Remove wallet"). Screen actions (Add, Save, Done) sit in the footer; never two competing primaries. A follow-up after a task is a footer choice requiring product review.
- Keep needed decision and safety context visible in
ink.text-secondary; use as much concise context as the task requires. Optional background can go behindBasicTooltipor "Learn more". Never move required information into a tooltip to meet a sentence quota. - Keep label hierarchy clear. A body heading below a task title adds distinct information; it
does not repeat the task. Receive uses the asset identity below the single “Receive” header,
as established in the owner review on 26 Oct 2026 (
recipes.md#receive-asset-identity). - Review facts use labels and values in key-value rows; keep required risk and decision context visible alongside them.
- After screenshotting, do a subtraction pass. Remove each element that doesn't change a decision.
Before you say done
Inspect the current equivalent app pattern first. For fees, read
apps/extension/src/app/features/fee-editor/fee-editor.tsx and its components/ before choosing
a composition. Reuse its decisions without copying known bulk or clipping problems.
At narrow widths, inspect every interactive state, including edit forms. Check each body
scroller's scrollWidth against clientWidth, not only the document: nested horizontal overflow
can be missed. Popup screens have one vertical body scroller with header/footer in reach; tab
pages may scroll as a whole.
Passing tokens and width checks is not enough. Follow Fees and transaction status for fee choices, Money/fiat, quote provenance, identity grouping and pending-state semantics. Review popup content inside its intended device frame, not stretched across the browser.
- Run
pnpm --filter @leather.io/<package> lint. For changed web/extension feature paths, also runpnpm design:check <changed-feature-path>from the repository root. Ordinary lint enforces design rules only on the shared recipes, recipe gallery and Receive example; other features need this explicit check. Mobile uses its native component and package checks. When a design rule fails, apply the replacement named in its message. Don't add suppressions. - Run
pnpm --filter @leather.io/<package> typecheck. - Look at it. For web or ui changes, render it in the web Playground (
pnpm devinapps/web, then/playground). Take a screenshot in light and dark, and attach before and after to the PR. For mobile, take a simulator screenshot. On Playground screens runpnpm design:align <url>(one gutter, symmetric header); it exits 1 on a finding. - Check the ladder. Is every piece of supporting text that informs a decision in
ink.text-secondary? Isink.text-subduedused only onink.background-primary? - If you needed something that isn't in
i-need-to.md, say so in the PR description. - In the Playground, every deviation from shipped UI, restyles included (
Caption.color,Button.size), needs a row inDEVIATIONS.mdwith a why.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

