Color resource
The UIKitPalette
and UIKitColors
interfaces manage a set of colors provided by UIKit for React Native. These colors are used in screens as background and text colors. While UIKit for React Native provides a default color set, you can customize the values of UIKitColors
or UIKitPalette
in UIKitTheme
to use different colors.
Primary
Primary color is the color displayed most frequently across your app's screens and components. It is not just a stylistic choice but a strategic tool for enhancing user experience, ensuring accessibility, and strengthening brand identity.
This image shows how primary colors are applied to various UI components like buttons and message bubbles.
Primary color variants
Your primary color can have different shades to create a comprehensive color theme for your app. This includes darker and lighter versions of the primary color, allowing for a more flexible and cohesive design across various UI components.
This image displays the gradient of primary colors from dark to light.
Primary-main
Used for elements like header buttons, outgoing message bubbles, spinners, and more in the light
theme.
Primary-light
Used for pressed state of buttons and outgoing message bubble in the dark
theme, such as the header button, outgoing message bubble, spinner and more.
Primary-dark
Used for pressed state of buttons and message bubbles in the light
theme.
Primary-extra dark
Used for selected state of reactions elements in the dark
theme.
Primary-extra light
Used for selected state of reactions elements in the light
theme.
Secondary
Secondary color provides more ways to accent and distinguish your product. Having a secondary color is optional, and should be applied sparingly to accent select parts of your UI.
Secondary color variants
Just like the primary color, your secondary color can have dark and light variants. A color theme can use your primary color, secondary color, and dark and light variants of each color.
This image displays the gradient of secondary colors from dark to light.
Secondary-main
Used for read receipt icons, broadcast icons, confirmations icons and more in the light
theme.
Secondary-light
Used for read receipt icons, broadcast icons, confirmations icons and more in the dark
theme.
Error
Typically, error colors do not represent the brand. Instead, they are used to highlight actions that users need to be cautious about, such as Delete
or Leave
functionalities, or to indicate important information like badges showing the number of unread messages.
Error color variants
Your error color can also have different shades to create a comprehensive color theme for your app, including darker and lighter versions of the error-main color.
This image displays the gradient of error colors from dark to light.
Error-main
Used for actions like Delete
and Leave
, and badges indicating the number of unread messages in the light
theme.
Error-light
Used for actions like Delete
and Leave
, and badges indicating the number of unread messages in the dark
theme.
Information
The information color is used to indicate important information, such as a status banner indicating frozen channels.
Information color variants
Your information color can also have different shades to create a comprehensive color theme for your app, including darker and lighter versions of the information-main color.
Information-extra light
Used for informational top banners to represent information such as the frozen status in the light
theme.
UIKitPalette
The UIKitPalette
interface provides a set of default colors you can use throughout your client app.
UIKitColors
The UIKitColors
interface provides a set of colors for each theme used in modules and module components. These colors are generated based on the color set of UIKitPalette
.
The overlapping objects of the ui
property in UIKitColors
are written as Component.Variant.State.ColorPart
. See the code below as an example.
How to use
You can use the colors in each view through the palette
and colors
properties of the theme.
Customize the colors
You can customize UIKitPalette
and UIKitColors
by either overriding the colors with the palette
and colors
properties of the existing theme or setting custom colors when creating a new theme. To change the colors while keeping the theme, we recommend overriding the colors with a custom palette
. If you wish to only change the colors in a certain module and its components, then use a custom colors
property.
Customize with default themes
If you only change the palette
property of the theme, then the colors
property is re-generated based on the customized colors of palette
. If you change both palette
and colors
properties, you must customize palette
first then colors
. See the code below on how to override the colors with palette
of LightUIKitTheme
.
Customize with createTheme()
See the code below on how to create a new theme with custom a palette
.