Repository navigation
0029 spotstrap recipes
Status: accepted · Implementation: done · Date: 2026-11-19 · Supersedes: 0027
From the move LibreLifts makes at the same time. Supersedes only the part of 0027 about where a component's classes come from. The components are still the app's own, written here, and React Native Reusables is still added only for behaviour that is hard to get right. Built 2026-11-19 with Spotstrap 0.1.3: Button, TextField, NumberField, the done tick in SetRow and the action in Problem. TextField has no visible label, so it uses input() alone. The tick is the recipe's 20-point box, centred in a 44-point cell so that it lines up with the fields. Checked in the iOS Simulator, light and dark: a set is logged and ticked, and the tick answers a tap 20 points from its centre.
0027 had the app write its first components by hand, each with
a map from a variant name to a full class string. 0028 then took the
theme from Spotstrap. Spotstrap also ships recipes for React Native
(@kodentuzo/spotstrap/recipes): plain functions that take a component's variant and state and
return its classes, { className, textClassName?, hitSlop? }, as full Uniwind class strings. They
are built from the same sizes and type scale as the website's components: 44-point targets,
36-point compact controls whose hit area is still 44, and Apple's text styles.
React Native has no :hover, :checked or ::after, so the recipes take state as options
(pressed, focused, checked, disabled) and give small targets a hitSlop instead of a
larger box. LibreLifts moves its components onto them at the same time, so the two apps' buttons
come out alike.
-
Button,TextField,NumberField,SetRow's done tick andProblem's action take their classes from the recipes:button(),field(),label(),input()andcheckbox(). They stay the app's own components, inapps/app/src/components, with the same props, andConfirmButtonkeeps asking twice. -
Button's variants map onto the recipe's:primary→default,secondary→outline,danger→destructive,quiet→ghost, andsmall→ thecompactsize. -
State is passed in, not written as a variant class. A component keeps whether it is
pressed or focused and passes it to the recipe, and passes the recipe's
hitSlopon. -
A recipe's text classes are not passed through
cn.tailwind-mergedoes not know Spotstrap's type scale, and takestext-bodyfor a colour that a latertext-foregroundreplaces. Classes a caller adds for layout are merged into the box classes only. -
Screen,Section,CardandNotestay as they are: they are layout, and Spotstrap has no recipe for them.
- The app's controls look like LibreLifts' and like the website's Spotstrap components, and change with them when Spotstrap is updated.
- Some controls look different: quiet buttons are no longer green, a destructive button is filled once it asks, buttons are 44 points high instead of 48, and their text is 17 points and medium instead of 16 and semibold.
- A recipe returns strings, so a mistake in one shows up only on screen. The simulator check stays the test.
- Variants the recipes do not have, such as a quiet button in the brand colour, are no longer available without a change to Spotstrap.
Generated from docs/ on dev. Edit the docs there; changes made on the wiki are overwritten.
- Development
- Workflow
-
Decisions
- 0001 Decisions are recorded
- 0002 Apache License 2.0
- 0003 Changes land on dev by fast-forward; main is the last release
- 0004 Conventional Commits, Keep a Changelog and Semantic Versioning
- 0005 docs/ is for developers and is mirrored to the wiki
- 0006 LibreBars is a free workout log for calisthenics
- 0007 The tracker is an iOS and Android app; its web build stays until the store release
- 0008 LibreBars is an app and a crowd-sourced open database
- 0009 The database is ODbL, media is CC BY-SA, and neither can be closed later
- 0010 A hosted API with a free tier is the paid product
- 0011 The workspace is app, web and api, with engine, ui, data and contracts
- 0012 The engine is small pure functions, in the style of date-fns
- 0013 Web and app share a Tailwind theme, not components
- 0014 Postgres is the source of truth for all data
- 0015 The API is Fastify, and it owns LibreBars accounts
- 0016 Every install is a guest account, made in the background
- 0017 Accounts use Better Auth
- 0018 The on-device database is SQLite with Drizzle, on every platform
- 0019 Sync is our own push and pull
- 0020 The app says it backs up, and backup can be turned off
- 0021 Postgres 18, run with Docker Compose and tested on two databases
- 0022 expo-sqlite is patched so the web build reuses one buffer
- 0023 Seed data is TypeScript modules in packages/data, with permanent ids
- 0024 The first tables
- 0025 One TanStack Start app is the website, on GitHub Pages
- 0026 The catalog reaches the app as a snapshot plus updates, and the website through the API
- 0027 The app's first components are its own
- 0028 The theme comes from Spotstrap, with shadcn's colour names
- 0029 The app's own components take their classes from Spotstrap's recipes