RORK LABJP
TEST — The Rork Companion app lets you test on a real iPhone without a paid Apple Developer accountCLOUD — Code compiles on a cloud Mac, streaming a 60fps live simulator with real touch inputBROWSER — Design, code, and test entirely in Chrome or Safari — no Xcode requiredPUBLISH — Two-click App Store publishing keeps the submission process simpleMAX — Rork Max builds native Swift apps for iPhone, iPad, Apple Watch, and Vision ProRN — Standard Rork generates iOS and Android apps together with React Native (Expo)TEST — The Rork Companion app lets you test on a real iPhone without a paid Apple Developer accountCLOUD — Code compiles on a cloud Mac, streaming a 60fps live simulator with real touch inputBROWSER — Design, code, and test entirely in Chrome or Safari — no Xcode requiredPUBLISH — Two-click App Store publishing keeps the submission process simpleMAX — Rork Max builds native Swift apps for iPhone, iPad, Apple Watch, and Vision ProRN — Standard Rork generates iOS and Android apps together with React Native (Expo)
Articles/Dev Tools
Dev Tools/2026-06-28Advanced

Build Your Settings Screen From One Schema and Reuse It Across Apps

Hand-building a settings screen per app falls apart as your app count grows. Here is a schema-driven design that assembles the screen from declarative data and shares a common base across multiple apps, with working code.

Rork469Expo119architecture10settingsindie developer31

Premium Article

A settings screen causes no trouble while you run a single app. You add a toggle, add a row, write it straight into the screen, and it works. The pain starts when a second and third similar app appear. As an indie developer at Dolice, I run several small wallpaper and calm-down apps in parallel, and at some point I realized I was copying the same setting rows into separate screens over and over. Theme switch, notifications on/off, clear cache — rows that exist in every app, each carried as a separate implementation, one per app.

When rows live directly inside screens, every change becomes "number of apps × number of edit sites." Changing a single word in the notification setting means opening six places. That is less a workload problem than a structural one: it is a structure that breeds omissions.

This article separates the settings screen into data (a schema) and rendering (a renderer), and shares the data across apps. It is written to drop straight into an Expo app generated by Rork.

What to peel off the screen

Break down what a settings screen is responsible for and you get roughly four things.

ResponsibilityExampleWhere it belongs
Item definitionA "Dark mode" toggle existsSchema (shared)
Value storagePersist true/false on the deviceStore (shared)
AppearanceDrawing rows, switches, dividersRenderer (shared)
Specific behaviorAn "Unlock Pro" row only this app hasPer-app difference

The first three are nearly identical in every app. Only the fourth differs. So if you share the three shareable parts ruthlessly and let the fourth be added as a small "difference," operations get dramatically lighter.

Define the schema with types

Start by deciding the type that represents a setting item. This is the backbone of the design. Responsibility is concentrated in this type, not in the screen.

// settings/schema.ts
export type SettingKind = "toggle" | "select" | "action" | "link";
 
export type SettingItem = {
  key: string;            // persistence key; never collide across apps
  kind: SettingKind;
  titleKey: string;       // i18n key; hold no raw strings
  // default for toggle / select
  defaultValue?: boolean | string;
  // options for select
  options?: { value: string; labelKey: string }[];
  // what action / link does
  onPress?: () => void | Promise<void>;
  // visibility condition; the whole row disappears if unmet
  visible?: (ctx: SettingsContext) => boolean;
};
 
export type SettingSection = {
  titleKey: string;
  items: SettingItem[];
};
 
export type SettingsContext = {
  isPro: boolean;
  platform: "ios" | "android";
};

Three things matter. Keep titleKey as an i18n key rather than a raw string. Make visible a function so conditions like "show only for Pro members" can be written declaratively. And give the item no behavior beyond onPress. The schema only says "what exists"; it never holds "how to draw."

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Collapse setting definitions into one declarative schema and let the UI generate itself
Where to draw the line between a shared base and per-app differences
Pushing persistence, validation, and ordering into the schema layer
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-06-28
Ship EAS Updates to a Few First, and Halt Automatically on Crash Rate
Because OTA updates reach everyone instantly, a bad update reaches everyone instantly too. Here is a three-layer design: ship EAS Update to a small canary, decide expand-or-halt from crash-free rate automatically, and hold a safety net on the device — with working code.
Dev Tools2026-06-18
Retrofitting Offline-First Into a Rork App: Persistent Cache and a Write Queue
Reviews kept saying the app was blank on the subway. Polishing error screens was not enough, so I retrofitted TanStack Query persistence and an offline write queue into a Rork-generated Expo app. Optimistic updates, reconnect flushing, and keeping the layer safe from regeneration are all covered with code.
Dev Tools2026-06-14
Actually Delivering 'It Updates Without Opening' in Expo — A Realistic Background Task Design
Building 'content refreshes every morning' into a Rork-generated Expo app runs into iOS background execution being far less dutiful than you expect. Here is a minimal expo-background-task setup plus a design that doesn't break when the task never runs.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →