Themes
A theme is a style that's applied to your entire app. A theme is made up of UIKitPalette, UIKitColors, and UIKitTypography. By default, Sendbird UIKit for React Native provides two themes: Light and Dark. But you can customize these themes to create your own brand identity by changing the value of resources.
UIKitTheme
See the code below to learn about the architecture of the UIKitTheme instance.
Light theme
This is the default theme for UIKit.
Background color
The background color of each component in Light theme ranges from Background-50 to Background-300.
Texts and other element colors
The following image shows the color scheme used for texts and other elements on light backgrounds.
UI elements and status colors
Primary-main and Secondary-main colors are used to highlight UI elements such as icon buttons, outgoing message bubbles, and read receipt icons. Error-main is used for warnings and Information-light is currently used for a status banner indicating frozen channels.
Dark theme
A dark theme is a user interface designed for low-light environments, featuring primarily dark surfaces. It serves as an alternative option to the default light theme, presenting dark-colored surfaces throughout much of the interface.
The Dark theme can be applied as below:
Note : The global theme should be configured prior to setting the view controller or creating a chat view.
Background color
The background color of each component in Dark theme ranges from Background-400 to Background-700.
Texts and other element colors
The following image shows the color scheme used for texts and other elements on dark backgrounds.
UI elements and status colors
Primary-light and Secondary-light colors are used to highlight UI elements such as icon buttons, outgoing message bubbles, and read receipt icons. Error-light is used for warnings and Information-light is currently used for a status banner indicating frozen channels.
Theme anatomy
The images below show the combination of background and text colors used in the Light and Dark themes.
Light theme
Dark theme
States
The images below show the various colors used to indicate different states in the Light and Dark themes. For Pressed and Selected states, the background color is either Primary-light or one level higher than that of the Enabled state.
Light theme
Dark theme
How to use
By calling the useUIKitTheme() hook, you can use the theme property of the SendbirdUIKitContainer context provider container.
Customize the theme
You can create your own custom theme by following the code below.