Skip to content

Commit 6f9d254

Browse files
committed
Add compatibility information for material themes
1 parent c17cc9a commit 6f9d254

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

versioned_docs/version-8.x/themes.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,18 @@ On Android, it also provides themes based on Material Design:
339339
- `MaterialLightTheme`
340340
- `MaterialDarkTheme`
341341

342-
The Material themes use platform colors to provide dynamic colors that adapt to the user's wallpaper and theme preferences.
342+
The Material themes use platform colors to provide dynamic colors that adapt to the user's wallpaper and theme preferences, and are available on Android 14 (API level 34) and above.
343343

344-
You can import the themes from the `@react-navigation/native` package:
344+
You can use the [`Platform`](https://reactnative.dev/docs/platform) API to fallback to a different theme on unsupported platforms or versions:
345+
346+
```js
347+
const MyTheme =
348+
Platform.OS === 'android' && Platform.Version >= 34
349+
? MaterialLightTheme
350+
: DefaultTheme;
351+
```
352+
353+
The themes can be imported from the `@react-navigation/native` package:
345354

346355
```js
347356
import {

0 commit comments

Comments
 (0)