Theme
UIKit for Jetpack Compose applies the theme using MaterialTheme
. All Color
, Typography
, and Shape
used in UIKit Compose are applied through MaterialTheme
. UIKit for Jetpack Compose provides its own custom SendbirdTheme
, allowing you to apply a consistent theme across all UIKit screens. To easily apply your app's MaterialTheme
to the UIKit, apply your app's custom MaterialTheme
to the UIKit.
There are several approaches you might take:
- Apply Dark mode and Dynamic Color
- Change the properties of Color, Typography, and Shape
- Apply the theme on a global level
Apply Dark mode and Dynamic Color
UIKit for Jetpack Compose provides SendbirdTheme
by default. You can apply Dark mode and Dynamic Color by using the SendbirdTheme
's isDarkTheme
, isDynamicColor
parameter.
Dark Mode
You can apply Dark Mode by setting the isDarkTheme
parameter of SendbirdTheme
to true
. The default will comply with the device's system settings.
Dynamic Color
You can apply Dynamic Color by setting the isDynamicColor
parameter of SendbirdTheme
to true
. The default is false
. To learn more about Dynamic Color, see here.
Change the properties of Color, Typography, and Shape
You can use the default ColorScheme
, Typography
, and Shapes
of Sendbird or customize them.
UIKit for Jetpack Compose provides the following properties:
sendbirdDarkColorScheme
,sendbirdLightColorScheme
: ColorScheme used in the UIKitsendbirdTypography
: Typography used in the UIKitsendbirdShapes
: Shapes used in the UIKit
Apply the theme on a global level
You can create your own Theme
and apply it to the UIKit for Jetpack Compose screens.
-
Create a custom
Theme
for your app. UIKit for Jetpack Compose is based onMaterialTheme
. Therefore, you can create a customTheme
for your app by referring to this guide. -
Select the target to apply the
Theme
.
2-1. Apply the Theme
to all UIKit screens. You can apply the Theme
to all UIKit screens through sendbirdGroupChannelNavGraph
. sendbirdGroupChannelNavGraph
receives the theme
property and delivers a consistent Theme
across the screens.
2-2. You can also apply the Theme
to a specific UIKit screen. To do so, wrap the composable function of the target screen with CustomSendbirdTheme
.
To apply the screen with the Theme
to the Navigation
, see our guide on Navigation.