Design an app that looks finished
Ynch previews can look as polished as a finished app. This guide walks through Realty Ready, a real estate exam app, and shows the definition behind each part of it. Every screenshot is from an iPhone running the app on its own Supabase database. Download the Realty Ready project (zip). It reads a Supabase database, so it needs one connected in Studio to show anything.




Nothing here is code. Each look is one of a fixed set of options, checked by ynch check before it ever reaches a phone.
1. Start with a dark theme
Section titled “1. Start with a dark theme”A dark background makes the iPhone draw everything else dark too: switches, pickers, the keyboard and the status bar follow the theme, not the phone’s setting. Beyond the nine required colors you can name your own, and you can define gradients.
{ "colors": { "background": "#0A0F1E", "surface": "#131B30", "primary": "#2DD4BF", "secondary": "#FBBF24", "text": "#F8FAFC", "muted": "#94A3B8", "border": "#24304D", "on-accent": "#FFFFFF", "raised": "#1B2542", "success-soft": "#0D2B26" }, "gradients": { "hero": {"colors": ["#0D9488", "#1D4ED8"], "direction": "diagonal"}, "action": {"colors": ["#14B8A6", "#3B82F6"], "direction": "right"}, "night": {"colors": ["#312E81", "#0F766E"], "direction": "diagonal"} }, "typography": { "display": { "fontFamily": "system", "fontSize": 32, "fontWeight": 700, "lineHeight": 38, "fontDesign": "rounded" }, "overline": { "fontFamily": "system", "fontSize": 12, "fontWeight": 600, "lineHeight": 16, "uppercase": true } }, "radii": {"none": 0, "sm": 8, "md": 14, "lg": 20, "xl": 28}}displayandoverlineare two of the four extra text styles. They work without being defined; this theme makesdisplayrounded.$radius.xlrounds the big banners;$radius.fullmakes a capsule, used for the white button.
Then define presets for the looks you repeat:
{ "hero": { "radius": "$radius.xl", "shadow": "large", "gradient": "$gradient.hero", "padding": "$spacing.lg", "gap": "$spacing.xs" }, "tile": { "radius": "$radius.lg", "backgroundColor": "$color.surface", "borderWidth": 1, "borderColor": "$color.border", "gap": "$spacing.none" }, "row-card": { "padding": "$spacing.md", "gap": "$spacing.sm", "radius": "$radius.lg", "backgroundColor": "$color.surface", "borderWidth": 1, "borderColor": "$color.border" }, "eyebrow": {"typography": "$typography.overline", "color": "$color.primary"}}See Theme and colors and Style options.
2. A hero banner over your own picture
Section titled “2. A hero banner over your own picture”A Cover draws its children over a bundled image, a gradient or a color. scrim: "bottom" darkens the lower half so white text stays readable on any picture.
{ "id": "hero", "type": "Cover", "props": { "height": "lg", "asset": "assets/hero.webp", "alt": "A house with lit windows under a bright moon", "scrim": "bottom", "contentAlign": "bottom" }, "preset": "hero", "children": [ { "id": "hero-eyebrow", "type": "Text", "props": {"text": "License exam prep"}, "preset": "on-hero-eyebrow" }, { "id": "hero-title", "type": "Text", "props": {"text": "Pass it the first time"}, "preset": "on-hero-title" }, { "id": "hero-note", "type": "Text", "props": {"text": "Real exam questions, one topic at a time."}, "preset": "on-hero-note" }, { "id": "hero-go", "type": "Button", "props": {"label": "See my progress", "variant": "filled", "icon": "chart"}, "action": {"type": "navigate", "routeId": "progress", "parameters": {}}, "style": { "backgroundColor": "$color.on-accent", "color": "$color.ink", "radius": "$radius.full", "margin": "$spacing.xs" } } ]}The picture is an ordinary file in .ynch/assets/. Images never come from a URL.
3. Cards colored by your data
Section titled “3. Cards colored by your data”Topics come from the database, and each row has its own color and icon columns. The card’s banner takes its color from the row with bindings.tint, and the icon takes its name from the row with bindings.value. Add a topic in the database and it appears with its own color, with no new release.
{ "id": "topic-list", "type": "RecordList", "props": {"pageSize": 25, "emptyText": "No topics yet", "separator": "none", "columns": 2}, "children": [ { "id": "topic", "type": "Card", "props": {}, "preset": "tile", "children": [ { "id": "topic-cover", "type": "Cover", "props": {"height": "sm", "contentAlign": "bottom"}, "children": [ { "id": "topic-icon", "type": "Icon", "props": {"name": "book", "label": "Topic", "size": "lg"}, "bindings": {"value": {"model": "topic", "field": "icon"}}, "style": {"color": "$color.on-accent"} } ], "bindings": {"tint": {"model": "topic", "field": "color"}}, "style": {"backgroundColor": "$color.raised", "align": "end"} }, { "id": "topic-body", "type": "Stack", "props": {}, "preset": "tile-body", "children": [ { "id": "topic-name", "type": "Text", "props": {"maxLines": 2}, "preset": "label", "bindings": {"value": {"model": "topic", "field": "name"}} }, { "id": "topic-about", "type": "Text", "props": {"maxLines": 2}, "preset": "note", "bindings": {"value": {"model": "topic", "field": "description"}} } ] } ], "action": { "type": "navigate", "routeId": "questions", "parameters": {"topic-id": {"source": "field", "model": "topic", "field": "id"}} } } ], "bindings": { "items": { "operationId": "list-topics", "parameters": {}, "pagination": {"offset": 0, "limit": 25} } }}columns: 2lays the rows out as a grid; cells in a row are the same height.- The
actionon the Card makes the whole card tappable, with press feedback, and passes the row’sidto the next screen. maxLines: 2cuts long descriptions off with an ellipsis.
4. Badges that match the value
Section titled “4. Badges that match the value”Difficulty is a text field holding easy, medium or hard. Three badges, each with a when, mean only the matching one is drawn:
{ "id": "question-tags", "type": "Row", "props": {}, "preset": "line", "children": [ { "id": "tag-easy", "type": "Badge", "props": {"text": "Easy"}, "when": { "model": "card", "field": "difficulty", "is": {"source": "literal", "value": "easy"} }, "style": {"color": "$color.success", "backgroundColor": "$color.success-soft"} }, { "id": "tag-medium", "type": "Badge", "props": {"text": "Medium"}, "when": { "model": "card", "field": "difficulty", "is": {"source": "literal", "value": "medium"} }, "style": {"color": "$color.secondary", "backgroundColor": "$color.amber-soft"} }, { "id": "tag-hard", "type": "Badge", "props": {"text": "Hard"}, "when": { "model": "card", "field": "difficulty", "is": {"source": "literal", "value": "hard"} }, "style": {"color": "$color.error", "backgroundColor": "$color.error-soft"} } ]}when compares a field with a fixed value or a route parameter. That is the only comparison there is; see Data-driven look.
5. Mark the right answer and the one you picked
Section titled “5. Mark the right answer and the one you picked”
Each answer row passes its own id to the answer screen as choice-id. There, the list of choices draws a green card only when is-correct is true, and a Your answer badge only when the row’s id equals the route’s choice-id:
{ "id": "answer-right", "type": "Card", "props": {}, "preset": "right", "children": [ { "id": "right-line", "type": "Row", "props": {}, "preset": "line", "children": [ { "id": "right-mark", "type": "Icon", "props": {"name": "check", "label": "Correct answer", "size": "sm", "tile": "circle"}, "style": {"backgroundColor": "$color.success", "color": "$color.ink"} }, { "id": "right-words", "type": "Text", "props": {}, "preset": "label", "bindings": {"value": {"model": "choice", "field": "choice-text"}}, "style": {"flex": 1} } ] }, { "id": "right-why", "type": "Text", "props": {}, "preset": "note", "bindings": {"value": {"model": "choice", "field": "explanation"}} }, { "id": "right-yours", "type": "Badge", "props": {"text": "Your answer", "icon": "check"}, "when": { "model": "choice", "field": "id", "is": {"source": "route", "parameter": "choice-id"} }, "style": {"color": "$color.ink", "backgroundColor": "$color.success"} } ], "when": {"model": "choice", "field": "is-correct", "is": {"source": "literal", "value": true}}}The save buttons use the same idea: the row for your pick decides which one appears.
{ "id": "save", "type": "Stack", "props": {}, "preset": "group", "children": [ { "id": "save-right", "type": "Button", "props": {"label": "I got it right. Save it", "size": "lg", "icon": "check"}, "when": { "model": "choice", "field": "is-correct", "is": {"source": "literal", "value": true} }, "style": {"width": "fill", "radius": "$radius.lg", "gradient": "$gradient.action"}, "action": { "type": "operation", "operationId": "record-answer", "parameters": { "card-id": {"source": "route", "parameter": "card-id"}, "times-seen": {"source": "literal", "value": 1}, "times-correct": {"source": "literal", "value": 1}, "mastery-level": {"source": "literal", "value": "reviewing"} } } }, { "id": "save-wrong", "type": "Button", "props": { "label": "I missed it. Save for review", "size": "lg", "icon": "bookmark", "variant": "tinted" }, "when": { "model": "choice", "field": "is-correct", "is": {"source": "literal", "value": false} }, "style": {"width": "fill", "radius": "$radius.lg"}, "action": { "type": "operation", "operationId": "record-answer", "parameters": { "card-id": {"source": "route", "parameter": "card-id"}, "times-seen": {"source": "literal", "value": 1}, "times-correct": {"source": "literal", "value": 0}, "mastery-level": {"source": "literal", "value": "learning"} } } } ]}6. Progress from stored numbers
Section titled “6. Progress from stored numbers”ProgressRing and ProgressBar take a fixed value from 0 to 100, or a number field of the row. Here both read the stored test score:
{ "id": "attempt-line", "type": "Row", "props": {}, "preset": "line", "children": [ { "id": "attempt-ring", "type": "ProgressRing", "props": {"label": "Score", "size": "sm"}, "bindings": {"value": {"model": "attempt", "field": "score"}} }, { "id": "attempt-words", "type": "Stack", "props": {}, "preset": "grow", "children": [ { "id": "attempt-title", "type": "Text", "props": {"text": "Practice test"}, "preset": "label" }, { "id": "attempt-count", "type": "Row", "props": {}, "children": [ { "id": "attempt-correct", "type": "Text", "props": {}, "preset": "note", "bindings": {"value": {"model": "attempt", "field": "correct-answers"}} }, { "id": "attempt-of", "type": "Text", "props": {"text": "correct out of"}, "preset": "note" }, { "id": "attempt-total", "type": "Text", "props": {}, "preset": "note", "bindings": {"value": {"model": "attempt", "field": "total-questions"}} } ], "style": {"gap": "$spacing.xs"} }, { "id": "attempt-bar", "type": "ProgressBar", "props": {"label": "Score", "size": "sm"}, "bindings": {"value": {"model": "attempt", "field": "score"}}, "style": {"margin": "$spacing.xs"} } ] } ]}Ynch shows numbers the database holds. It does not add up or average rows, so a total like “68% exam ready” has to be stored by your database (a view works well) before an app can show it.
- A color does not pass from a container to the text inside it. Give each Text its color, usually through a preset such as
on-hero-title. - Keep text on pictures short and use a scrim.
- Check every screen on the phone in both small and large text sizes; two-column lists switch to one column at the largest sizes.