Debuta ships with a full light and dark color system backed by a React context. Every color used across the app is derived from a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/desarrolladorandres2026-gif/Native-tailwind/llms.txt
Use this file to discover all available pages before exploring further.
colors object returned by useTheme() — no raw hex values are scattered through components. The active palette switches automatically in response to the device’s system setting, or it can be locked to a specific mode by the user and persisted between sessions.
ThemeProvider and useTheme
ThemeProvider lives at the very top of the provider tree in app/_layout.tsx, wrapping every other provider and screen:
app/_layout.tsx
useTheme():
ThemeContextValue
| Property | Type | Description |
|---|---|---|
colors | ColorTokens | The active color palette (light or dark) |
isDark | boolean | true when the dark palette is active |
themeMode | ThemeMode | The current mode setting: 'light', 'dark', or 'system' |
setThemeMode | (mode: ThemeMode) => void | Persist a new mode to AsyncStorage and apply it immediately |
toggleTheme | () => void | Flip between light and dark (ignores 'system' — sets an explicit mode) |
ThemeMode
theme/ThemeContext.tsx
- system (default)
- light
- dark
The app follows the device’s system color scheme via React Native’s
useColorScheme(). When the device switches between light and dark mode, the app updates instantly without any user action.Persistence
The chosenThemeMode is saved to and loaded from AsyncStorage under the key debuta_theme_mode.
theme/ThemeContext.tsx
'system', so users automatically see the palette that matches their device without any configuration.
Color Token Reference
Both palettes expose exactly the same token names. SwapDARK_COLORS for LIGHT_COLORS in your head to see how each token differs.
DARK_COLORS
| Token | Value | Usage |
|---|---|---|
bg | ['#050505', '#160B2A', '#050505'] | Linear gradient array for full-screen backgrounds |
card | #121212 | Surface color for cards and modals |
inputBg | rgba(20, 20, 35, 0.6) | Text input and form field backgrounds |
glassBorder | rgba(255, 255, 255, 0.1) | Borders on glassmorphism elements |
text | #FFFFFF | Primary text |
textDim | #D1D5DB | Secondary / subdued text |
textLight | #9CA3AF | Placeholder, caption, and hint text |
primary | #8B5CF6 | Brand accent (buttons, active states) |
secondary | #D946EF | Secondary actions and highlights |
tertiary | #6366F1 | Tertiary accents and decorative elements |
error | #EF4444 | Destructive actions, error states |
success | #10B981 | Confirmations, success states |
warning | #FFD700 | Warnings and cautionary states |
LIGHT_COLORS
| Token | Value | Usage |
|---|---|---|
bg | ['#FFFFFF', '#F8F9FA', '#FFFFFF'] | Linear gradient array for full-screen backgrounds |
card | #FFFFFF | Surface color for cards and modals |
inputBg | rgba(0, 0, 0, 0.05) | Text input and form field backgrounds |
glassBorder | #EEEEEE | Borders on cards and dividers |
text | #000000 | Primary text |
textDim | #424242 | Secondary / subdued text |
textLight | rgba(66,66,66,0.5) | Placeholder, caption, and hint text |
primary | #FD297B | Brand accent (buttons, active states) |
secondary | #FF655B | Secondary actions and highlights |
tertiary | #FF5864 | Tertiary accents and decorative elements |
error | #EF4444 | Destructive actions, error states |
success | #10B981 | Confirmations, success states |
warning | #FFD700 | Warnings and cautionary states |
bg is a tuple of at least two strings so it can be passed directly to expo-linear-gradient’s colors prop without any mapping. The dark palette uses a deep purple midnight gradient; the light palette uses an off-white soft gradient.System Color Scheme Reactivity
The provider callsuseColorScheme() from React Native and sets up an effect that re-evaluates isDark whenever either themeMode or the system scheme changes:
theme/ThemeContext.tsx
themeMode set to 'system' and they change their device setting while the app is running, the colors update immediately with no restart required.
Using useTheme in a Component
Here is a complete example of a theme-aware screen card built using the color tokens:Changing the Theme Programmatically
To let users choose their preferred mode from a settings screen:setThemeMode is async because it persists the choice to AsyncStorage before updating the React state. You can await it if you need to confirm the write, or call it fire-and-forget — the UI updates synchronously on the next render regardless.