Skip to content

React Native Paper 5.0 adds Material You (MD3) support

updated

React Native Paper 5.0 is centered on bringing Material Design 3, also known as Material You (MD3), into the react-native-paper library. Components were refined against the official Figma design kit, with updates to colors, typography and animations.

MD2 and MD3 side by side

There will be no further v4 releases, but version 5.0 supports both Material Design generations 2 and 3, so existing designs can be kept. Both are supported, though not simultaneously. A new version property in the theme selects the design system: 3 (the default, MD3) or 2 (MD2).

theme: {
/* ... */
version: 3 | 2
}

Helpers

  • adaptNavigationTheme takes React Navigation themes in both modes and returns equivalents adjusted to Material Design 3, which can be passed to NavigationContainer so navigation UI matches the Paper color scheme.
  • configureFonts has been adjusted for the new variant-based fonts (for example displayLarge or bodyMedium). It accepts a config object with font modifications for the relevant Material Design version and outputs an adjusted theme font object.
  • createDynamicThemeColors is currently not in the library; instead, the Theming section of the docs includes a tool that generates lightScheme and darkScheme from a source color, which can be passed to the theme's colors.

New components

  • SegmentedButtons, described as a refined version of ToggleButton, for selecting options, switching views or sorting elements, with single and multi-select variants.
  • Tooltip, shown on tap-and-hold to display an informative label, available for both Material Design systems.
  • Drawer.CollapsedItem (Navigation Rail), a side navigation item with an icon and optional label for use within Drawer.

Changes from 4.0

  • BottomNavigation is taller, has no shadow, and uses filled icons with a pill-shaped active indicator for active states and outlined icons for inactive ones.
  • Appbar now comes in center-aligned, small, medium and large types, each with larger default text and height and no drop shadow by default.
  • Button has fully rounded corners, taller height and sentence-case text, and gains elevated, filled and filled-tonal types. To stay consistent with the codebase, filled remains named contained, and filled-tonal is named contained-tonal.

A migration guide covering all breaking changes is available for moving to React Native Paper 5.0.

Video

Source: www.callstack.com