Skip to content
All posts

Achieve True Cross-Platform Consistency with OTF's Unified Component System

DaveOTF Kit
8 min read
Achieve True Cross-Platform Consistency with OTF's Unified Component System

Cross-platform consistency does not require identical component APIs on every platform. It depends on reusing component names where the shared set exists and keeping design tokens aligned, while letting web and React Native expose the props each platform needs. This guide separates what can be shared from what should remain platform-specific.

The parity tax, line by line

Every cross-platform project ships a balance sheet nobody wants to read. Three button components that drift apart over six months. Three inputs where the Android one loses its focus ring. Three loading spinners that look related but aren't. None of it is dramatic. All of it costs.

The line items:

  • Build drift. You write <Button> on Tuesday, ship a new prop on Wednesday on iOS, push the same prop to web on Friday, forget Android until QA pings you three weeks later. The bug isn't the prop — it's the calendar.
  • Design drift. A designer tweaks the primary colour in Figma on a Tuesday. The web theme updates in a PR the same day. Native ships the old shade for a quarter because the token export from Figma never reached the native repos.
  • Refactor drag. Changing one component means auditing three codebases, three type files, three test suites, three sets of snapshots, and three different review queues. The PR is 200 lines. The deployment dance is 2,000.

Three platforms. Three of everything. That's the tax.

Shared component names, platform-specific props

The web package and the React Native package include a shared set of component names. That gives a team a familiar vocabulary across platforms, while each implementation keeps the props and event conventions that fit its runtime.

For example, a web button can use a web-specific variant and click handler:

import { Button } from '@otfdashkit/ui'

export function WebCTA() {
  return <Button variant="outline" onClick={startCheckout}>Get started</Button>
}

The React Native button has its own variant names and press handler:

import { Button } from '@otfdashkit/ui-native'

export function NativeCTA() {
  return <Button variant="outlined" onPress={startCheckout}>Get started</Button>
}

The component name is familiar, but the variant vocabulary is not a cross-platform contract. For example, the web Button variants include default, secondary, outline, ghost, destructive, link, gradient, texture, and shimmer; the native Button variants include primary, default, outlined, transparent, floating, destructive, and shimmer. Event handling also follows each platform: web uses browser events such as onClick, while React Native uses onPress.

The current SDK catalog contains 240+ components: 150+ for web and 85+ for native. Treat that as the combined catalog count, not as 240+ components available on every platform. Check the package documentation for the platform-specific API before porting a screen. Shared naming helps you find the corresponding building block; it does not mean every prop or behavior is identical.

One codebase. iOS, Android, and web.

The Fitness Kit is a mobile starter with its own API, with sign-in and a database. Live demo at fitness-preview.otf-kit.dev.

See the live demo

Tokens are the source of truth

Components are half the problem. The other half is colour, spacing, type, radius — the visual grammar. If those drift, the components drift with them, and no amount of component-library discipline will save you.

Install the token package alongside the components:

npm i @otfdashkit/ui @otfdashkit/ui-native @otfdashkit/tokens

Tokens look like this:

import { tokens } from '@otfdashkit/tokens'

export const theme = {
  color: {
    bg: { primary: tokens.color.blue[600], surface: tokens.color.gray[50] },
    text: { primary: tokens.color.gray[900], muted: tokens.color.gray[600] },
  },
  space: { 1: tokens.space[1], 2: tokens.space[2], 4: tokens.space[4] },
  radius: { sm: tokens.radius.sm, md: tokens.radius.md },
}

Flip bg.primary from blue to teal once, on one platform. All three update. A shared token value can inform each platform's rendering, but platform conventions and layout mean the resulting pixels and spacing need not be identical. Visual parity is a property of the token graph, not a hope held by the team.

Theme switching is the same primitive. A dark theme is a second token export. Components don't know it exists — they consume whatever the current theme hands them, and the theme is the only thing that knows which mode is active.

The 24-item gate before anything ships

Most cross-platform libraries ship whatever compiles. The cross-platform kits ship after a script gates them against a 24-item design checklist. Touch targets meet platform minimums. Contrast passes WCAG AA. Focus rings are visible against every background token. Safe-area insets are honoured on every sheet and modal.

The checklist is enforced, not aspirational. A kit doesn't reach npm publish until the script returns zero. That's the difference between "looks right on my laptop" and "passes review on a real device, in dark mode, with the user's preferred text size".

A few items from the actual list:

CheckWhy it matters
Tap target ≥ 44pt iOS / 48dp AndroidApp Store and Play Store floor
Contrast ratio ≥ 4.5:1 for body textWCAG AA, also just legible
Dark-mode parity per tokenNo "almost dark" surfaces
Safe-area inset handlingNotch, dynamic island, gesture bar
Reduced-motion fallbackSystem setting respected, not ignored

If a kit fails any one of those, it doesn't ship. The gate is the contract.

AI agents extend, they don't regenerate

This is the part most cross-platform stacks get wrong. Hand an AI coding agent a fresh empty repo and it invents its own conventions. Hand it a kit with no documentation and it does the same thing, but louder.

Every full-stack kit ships the conventions the agent needs to extend the kit instead of replacing it:

my-app/
├── CLAUDE.md            # how the kit is structured
├── .cursorrules         # what the agent must / must not change
├── ai/
│   └── prompts/         # 20+ task prompts for common tasks
└── src/
    └── ...              # your code, on top of the kit

CLAUDE.md says: this is a cross-platform kit, components live here, tokens flow through here, do not regenerate <Button>. .cursorrules says the same thing in Cursor's dialect. The 20+ prompts in ai/prompts/ are the ones actually used to extend real kits — add a screen, wire auth, add a Stripe product, scaffold a new page, hook up a server action.

The agent extends. It doesn't replace. Convention beats configuration, and the convention is written down.

shared component names and design tokens across separate web, iOS, and Android implementations; AI agent review

From dev to production

Cross-platform parity doesn't end at "it renders correctly in dev". You still need a domain, DNS, TLS, and a mobile build that survives App Store review. The SaaS Dashboard kit and the Fitness kit both ship a deploy script for the web side:

DOMAIN=my-app.example.com bash scripts/deploy-worker.sh

What it does: builds the web app and deploys it to Cloudflare Workers (the app and its API for SaaS Dashboard; the static web demo for Fitness). With DOMAIN set, it attaches that custom domain on a Cloudflare zone you already own, and Cloudflare provisions the TLS certificate. Registering the domain and building the iOS and Android binaries with EAS (Fitness ships eas.json) are separate steps. OTF's own live demos run on Cloudflare Workers.

That's the boring half of cross-platform nobody talks about at a hackathon and everybody pays for the week before launch.

What this enables

A team of two shipping iOS, Android, and web apps can reuse component names and design tokens while keeping each platform’s implementation and props distinct. A designer can change a shared token and verify how each platform renders it. An AI agent that asks "where do I add a new screen?" and gets a real answer from CLAUDE.md instead of inventing a fourth codebase. A release that doesn't need a "wait, does this work on Android?" channel in Slack on Friday afternoon.

You can start in two ways:

# Option A — copy-paste CLI, scaffolds into the current directory
npx otf-kit init

# Option B — straight npm install, bring your own scaffold
npm i @otfdashkit/ui @otfdashkit/ui-native @otfdashkit/tokens

The free MIT SDK is on npm, with 240+ components across its web and React Native packages (150+ web and 85+ native). Shared names do not imply identical props or a single implementation. The purchasable kits provide authentication and database foundations, plus their own product screens; app billing and Stripe are not included in SaaS Dashboard or Fitness. You own the code and can add the payment integration your product needs. 20 single-page landing templates at $9 each when all you need is a marketing surface.

Closing

Cross-platform parity is one of those problems everyone agrees is real and almost nobody fixes at the level it deserves. The useful goal is a familiar component vocabulary where the packages overlap, shared design tokens, and platform-specific APIs that are clear enough to extend safely. The model layer underneath will keep churning — context windows will grow, prices will drop, agents will get smarter. The render target underneath the model layer won't.

Use familiar component names across packages; keep platform-specific props and implementations. Sleep on launch night.

Sources

cross-platformdesign-systemtemplates
OTF Fitness Kit

Stop wiring. Start shipping.

  • Sign-in and a database wired in, with its own API
  • iOS + Android + web from one codebase
  • AI configs pre-tuned + 20+ task prompts per kit included
Free starter

Ship your first screen tonight — free starter in your inbox

The quickstart, the SDK repo and the live kit demos, on this screen and in your inbox.

No spam. Unsubscribe any time.

Free with your email

Get the free AI configs pack

The AI files every kit ships with. Drop them in and your AI tool knows your project.

  • CLAUDE.mdProject context
  • .cursorrulesRules for Cursor
  • prompts/Task prompts

No spam. Unsubscribe any time.