WhoBuilt

Creating Design Systems in React Native

Sep 22, 2023· 26 min· 5.5K views·Watch on YouTube

Speaker

Marek Fořt of Shopify explains how the team built and scaled its React Native design system at React Native EU 2023.

A gradual migration needs a strong design system

Shopify’s core mobile app has more than 600 screens per platform, so the team chose to migrate gradually instead of pausing product work for a full rewrite. Polaris Mobile helps teams move faster during that migration, drawing on Shopify’s web Polaris for icons, tokens, component patterns, and documentation ideas.

Treat the design system as an internal product

Fořt describes keeping the package loosely coupled from the app, documenting components as a source of truth, and providing changelogs and contribution guidelines. Extracting Polaris Mobile into its own monorepo package also made it easier for feature teams to contribute.

Balance consistency with flexibility

A limited set of reusable components is easier to find and maintain, while a shared theme helps keep interfaces consistent. Shopify uses Restyle and TypeScript to constrain colors and other design values to theme tokens, with autocomplete for developers. For complex components, the team favors composing smaller subcomponents over endlessly expanding a long list of props.

Build a repeatable component workflow

The team uses granular screenshot tests for design system components and screen-level tests in the app, along with Storybook, Docusaurus, and FlashList. Fořt demonstrates scaffolding a Badge component, using theme-based spacing, and drawing examples from a shared file for stories, screenshots, and documentation. Screenshot comparisons help teams review visual changes and update reference images.

Extend Polaris across Shopify apps

Polaris Mobile is already used in Shopify Balance, with plans to bring it to more Shopify apps so they share a design language. The team also aims to bring the mobile and web frameworks closer together.

Takeaways

  • For large apps, gradual screen migration can keep product work moving while the design system supports consistency.
  • Treat an internal design system as a product: document components, publish changes, and make contributions straightforward.
  • Use a shared typed theme to make design tokens easy to discover and harder to bypass.
  • When complex components accumulate props, identify smaller parts that teams can compose.
  • Use shared examples to power component stories, documentation, and screenshot tests from one source.

Mentioned in this talk

Search inside this talk

What was claimed 15

Related talks