skip to content

In Jetpack Compose, should a banking app with its own brand palette and spacing scale extend MaterialTheme, replace its subsystems, or build a fully custom design system?

level: principalimportance: should knowfreq 30%

answer

  1. three documented approaches
  2. who keeps Material's defaults
  3. what MaterialTheme provides besides colors
  4. wrappers and team rules

basics

~20 s

Usually extend MaterialTheme: brand ColorScheme, Typography and Shapes, plus spacing and semantic colors in custom CompositionLocals, so Material components keep sensible defaults. Replacing subsystems or going fully custom means wrapping or rebuilding every component you use.

solid answer

~40 s

Compose documents three paths. **Extending** keeps `MaterialTheme` with brand schemes and adds what Material lacks, such as a spacing scale and positive or negative amount colors, as `@Immutable` token classes in `CompositionLocal`s behind an object like `BankTheme`; Material components keep working. **Replacing** typography or shapes means Material components still read Material's values, so each must be wrapped. A **fully custom** system drops `MaterialTheme` and with it its text selection colors and ripple indication, leaving components on baseline values unless you wrap or rebuild them. I would extend unless the brand's concepts do not fit Material's roles, then ship wrapper components in a design-system module and enforce them in review or lint. The trade is brand purity against a large, accessible component library.

go deeper

for a junior

Know that a brand can be expressed by passing custom colors, type and shapes to MaterialTheme, and that extra values can come from your own theme object.

for a middle

Describe the three approaches and how each affects Material components' default colors, text styles and shapes.

for a senior

Build the chosen layer: token classes, providers, an access object, and wrapper components that feed custom values into Material ones.

for a principal

Weigh brand fit, component reuse, dynamic color and theme count, then set the team rules that keep screens on the design-system layer.

## The three options Compose gives you The Android guide to custom design systems lists three ways to bring an existing brand into Jetpack Compose, and they map directly onto the decision a lead makes: | Approach | What you build | Material components | Cost | |---|---|---|---| | **Extend `MaterialTheme`** | brand `ColorScheme`, `Typography`, `Shapes`, plus extra tokens in your own `CompositionLocal`s | keep sensible defaults from the theme | smallest; Material's own roles must still be filled sensibly | | **Replace some subsystems** | your own type or shape classes, keep Material's colors | show Material values for the replaced systems unless wrapped | every used component needs a wrapper | | **Fully custom design system** | your own theme function and object, no `MaterialTheme` | fall back to baseline Material values and behavior | highest; you own every component and system | ## Extending Material You pass brand values into `lightColorScheme(...)`, `darkColorScheme(...)`, `Typography(...)` and `Shapes(...)`, and add what Material lacks (a spacing scale, positive and negative amount colors) through `CompositionLocalProvider` with an `object BankTheme` exposing `@Composable` getters. Material components keep working, and you wrap only the ones that need an extra token, for example a `BankCautionButton` that sets `ButtonDefaults.buttonColors(containerColor = BankTheme.colors.caution, ...)`. Simple additions can even be extension properties such as `val ColorScheme.positiveAmount`, but the guide recommends them only for straightforward values or values that are the same across themes; with several themes, a token class in a `CompositionLocal` is cleaner. ## Replacing or dropping Material Replacing typography or shapes means Material components still read Material's own values, so each one you use must be wrapped and fed your values, sometimes through `ProvideTextStyle` around its content because not every value is a parameter. A fully custom theme goes further: besides colors, type and shapes, `MaterialTheme` also provides **text selection colors** and a **ripple indication**, and without it Material components render baseline Material values. If the brand has concepts Material cannot express (gradient backgrounds as `List<Color>`, for example), the guide suggests building those components from scratch rather than wrapping. ## How a lead decides The honest answer depends on the brand and the team, so weigh: 1. **Fit.** If the brand palette maps onto primary, secondary, surface and container roles, extending is cheap. If the brand thinks in different roles, forcing it into Material's names produces confusing code. 2. **Component reuse.** Material ships accessible text fields, dialogs, date pickers and navigation components. Dropping `MaterialTheme` means either wrapping each one carefully or rebuilding it, plus its accessibility behavior. 3. **Dynamic color.** Material's dynamic schemes only produce a `ColorScheme`. If dynamic color is in scope even for some flows, staying on `MaterialTheme` keeps that option; a custom color system has to opt out of it or map the dynamic scheme onto its own roles. 4. **Theme count.** One brand with light and dark fits any approach; several white-label brands push toward token classes in composition locals regardless of approach. 5. **Team rules.** Whatever you pick, the design-system layer only holds if screens use it. Typical rules: screens use the `Bank*` wrapper components and `BankTheme` tokens, raw `Color(0x...)` literals and direct `dp` spacing values outside the design-system module are rejected in review or by a lint check, and the token classes are generated from the design team's token source rather than copied by hand. ## A sensible default for the banking case For a bank with a brand palette and a spacing scale but no exotic visual concepts, a common recommendation is: - **Extend `MaterialTheme`** with brand schemes for light and dark and complete the color roles, not just `primary`. - Add **custom tokens** (spacing, semantic amount colors) as `@Immutable` classes provided through `CompositionLocal`s, with an object that mirrors `MaterialTheme`'s access style. - Ship a small set of **wrapper components** in a design-system module and keep raw Material components for the rest. - Revisit a fully custom system only if wrappers start overriding most of Material's defaults; at that point Material is cost, not help. Whichever path you choose, write the decision down with its trigger for revisiting, for example "if more than half of the wrappers override most Material defaults", so the next lead does not re-litigate it from scratch. The trade-off to say out loud: extending trades some brand purity for a large free component library; going custom buys full control at the price of owning every component, its states and its accessibility.

  • When are extension properties such as ColorScheme.positiveAmount enough instead of a token class?
    The Android guide recommends extension properties only for straightforward additions or values that stay the same across themes. Once values differ per theme or brand, a token class provided through a `CompositionLocal` and nested like `MaterialTheme` is cleaner and keeps one place that decides the values.
  • What makes a design-system layer actually stick across feature teams?
    Make the right path the easy path: wrapper components and token objects in a design-system module, generated from the design team's token source, and checks that reject raw color literals and hardcoded spacing outside that module. Previews wrapped in the app theme make drift visible in review.

Extending MaterialTheme is like fitting a branded interior into a standard office building; going fully custom is building your own, where you also own the wiring, lifts and fire exits.

  • A fully custom theme still gives Material components their ripple and selection colors.
  • Replacing Material's Typography automatically restyles every Material component.
  • Extending MaterialTheme means brand tokens must squeeze into Material's color roles.
  • Dynamic color works the same whichever design-system approach the app takes.