You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/themes.md
+75-4Lines changed: 75 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ title: Themes
4
4
sidebar_label: Themes
5
5
---
6
6
7
-
Themes allow you to change the colors of various components provided by React Navigation. You can use themes to:
7
+
Themes allow you to change the colors and fonts of various components provided by React Navigation. You can use themes to:
8
8
9
-
- Customize the colors match your brand
9
+
- Customize the colors and fonts to match your brand
10
10
- Provide light and dark themes based on the time of the day or user preference
11
11
12
12
## Basic usage
@@ -36,22 +36,37 @@ export default function App() {
36
36
37
37
You can change the theme prop dynamically and all the components will automatically update to reflect the new theme. If you haven't provided a `theme` prop, the default theme will be used.
38
38
39
+
## Properties
40
+
39
41
A theme is a JS object containing a list of colors to use. It contains the following properties:
40
42
41
43
-`dark` (`boolean`): Whether this is a dark theme or a light theme
42
44
-`colors` (`object`): Various colors used by react navigation components:
43
45
-`primary` (`string`): The primary color of the app used to tint various elements. Usually you'll want to use your brand color for this.
44
-
-`background` (`string`): The color of various backgrounds, such as background color for the screens.
46
+
-`background` (`string`): The color of various backgrounds, such as the background color for the screens.
45
47
-`card` (`string`): The background color of card-like elements, such as headers, tab bars etc.
46
48
-`text` (`string`): The text color of various elements.
47
49
-`border` (`string`): The color of borders, e.g. header border, tab bar border etc.
48
-
-`notification` (`string`): The color of Tab Navigator badge.
50
+
-`notification` (`string`): The color of notifications and badge (e.g. badge in bottom tabs).
51
+
-`fonts` (`object`): Various fonts used by react navigation components:
52
+
-`regular` (`object`): Style object for the primary font used in the app.
53
+
-`medium` (`object`): Style object for the semi-bold variant of the primary font.
54
+
-`bold` (`object`): Style object for the bold variant of the primary font.
55
+
-`heavy` (`object`): Style object for the extra-bold variant of the primary font.
56
+
57
+
The style objects for fonts contain the following properties:
58
+
59
+
-`fontFamily` (`string`): The name of the font family (or font stack on Web) to use, e.g. `Roboto` or `Helvetica Neue`. The system fonts are used by default.
60
+
-`fontWeight` (`string`): The font weight to use. Valid values are `normal`, `bold`, `100`, `200`, `300`, `400`, `500`, `600`, `700`, `800`, `900`.
49
61
50
62
When creating a custom theme, you will need to provide all of these properties.
0 commit comments