This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Material Colors
Read the Material 3 color palette (including Material 3 Dynamic Colors) from JavaScript.
Expo UI Jetpack Compose exposes the Material 3 color palette used by Jetpack Compose so you can pick a palette source and have every component under a <Host> theme from it consistently.
The palette source depends on the options you pass:
- Wallpaper-derived: Default on Android 12+ when no
seedColoris given. Uses Material 3 Dynamic Colors (Material You). - Static Material 3 baseline: Default fallback on Android 11 and below when no
seedColoris given. - Seeded from a color: When you pass a
seedColor, the full palette is derived using the same algorithm that Material 3 Dynamic Colors use for wallpaper-based colors. Works on every Android API level and is independent of the wallpaper.
Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Theming <Host> from a seed color
Host accepts seedColor and colorScheme props directly. This is the recommended way to theme a Compose subtree. Native Compose components under this Host render with the seeded palette and any descendant that calls useMaterialColors() without arguments receives the same palette from the Host's context.
Reading the current palette inside Host
Call useMaterialColors() without arguments inside a <Host> to read the Host's current palette. The hook returns a reference-stable MaterialColors object and does not cross the native bridge on re-renders.
Computing a specific palette with arguments
Pass arguments to useMaterialColors() to compute a palette on demand, even outside a <Host>. The colorScheme takes 'light' or 'dark', you can omit it to follow the system.
Reading colors outside React components
API
No API data file found, sorry!