How theming works
Universal Components for Android use a Jetpack Compose theme that mirrors Material 3’sMaterialTheme pattern.
You can wrap SDK content using Auth0Theme { ... } to provide tokens, or pass themeConfiguration directly to AuthenticatorSettingsComponent.
You can read tokens inside any composable using Auth0Theme.colors, Auth0Theme.typography, Auth0Theme.shapes, Auth0Theme.dimensions, and Auth0Theme.sizes.
Zero configuration
If you do not configure a theme, Universal Components for Android render the Auth0 default theme. The following example displays theAuthenticatorSettingsComponent without any customization:
No additional setup is required to load the Auth0 default theme. Universal Components apply it automatically when no custom theme is provided.
Override a subset of tokens
You can override specific tokens while Universal Components for Android render every other token using the Auth0 default theme. The following example overrides the tokensAuth0Color.light().copy(...), Auth0Color.dark(), or Auth0Typography.default().copy(...):
Force dark mode
To force dark mode, you can wrap the component inAuth0Theme(darkTheme = true) or pass the dark color scheme explicitly:
Configure a full brand theme
Provide your own branding theme that combines colors, typography, and shapes into a singleAuth0ThemeConfiguration configuration:
Read theme tokens in your own composables
Access theme tokens inside anAuth0Theme { ... } composable using the accessor object:
Switch themes at runtime
You can keep the theme configuration in state to swap between light and dark (or brand variants) without recreating the screen:Token reference
Colors — Auth0Color
Colors — Auth0Color
To customize colors use
Auth0Color.light() and Auth0Color.dark() factories as starting points and .copy(...) to override specific tokens.| Token | Usage |
|---|---|
backgroundPrimary, backgroundPrimarySubtle, backgroundInverse, backgroundAccent | CTA and accent surfaces |
backgroundLayerTop, backgroundLayerMedium, backgroundLayerBase | Overlay, card, and app-background layers |
backgroundError, backgroundErrorSubtle, backgroundSuccess, backgroundSuccessSubtle | Feedback surfaces |
borderBold, borderDefault, borderSubtle, borderShadow | Emphasis and elevation borders |
textBold, textDefault, textDisabled | Heading, body, and disabled text |
textOnPrimary, textOnSuccess, textOnError | Text on colored surfaces |
Typography — Auth0Typography
Typography — Auth0Typography
To customize typography use the compose token
TextStyle. You can override it with Auth0Typography.default().copy(...).| Token | Usage |
|---|---|
displayMedium, display | Hero and major screen headings |
titleLarge, title | Screen titles, in-content titles |
body, bodySmall | Descriptions, body copy, footnotes |
label | Button labels, form field labels |
helper, overline | Captions, helper text, category labels |
Shapes — Auth0Shapes
Shapes — Auth0Shapes
| Token | Usage |
|---|---|
none | No rounding |
extraSmall, small, medium, large, extraLarge | Standard rounding scale |
full | Fully rounded (pill) |
Dimensions — Auth0Dimensions
Dimensions — Auth0Dimensions
Spacing defaults to a
4 dp grid. Access spacing tokens with Auth0Theme.dimensions.*.| Token | Default | Description |
|---|---|---|
spacingXxs | 4 dp | Minimal gap between tightly coupled elements |
spacingXs | 8 dp | Small gap between grouped elements |
spacingSm | 12 dp | Medium internal padding |
spacingMd | 16 dp | Standard component and container padding |
spacingLg | 24 dp | Larger padding for major sections |
spacingXl | 32 dp | Extra-large padding |
spacingXxl | 48 dp | Double-extra-large padding |
Sizes — Auth0Sizes
Sizes — Auth0Sizes
Access component dimensions with
Auth0Theme.sizes.*.| Token | Default | Usage |
|---|---|---|
buttonHeight | 56 dp | All primary and secondary action buttons |
inputHeight | 68 dp | Text and phone-number input fields |
otpFieldWidth | 52 dp | Width of a single OTP digit input field |
otpFieldHeight | 60 dp | Height of a single OTP digit input field |
codeContainerHeight | 56 dp | Recovery code display containers |
iconSmall | 16 dp | Small icons—chevrons, info indicators, checkmarks |
iconMedium | 24 dp | Standard icons—authentication-method images |
iconLarge | 32 dp | Large icons—three-dots menu |
padding | 16 dp | Default component padding |
paddingLarge | 24 dp | Larger component padding |
Learn more
Install the Android SDK
Platform prerequisites and installation for Android.
Build a Self-Service Account Security Interface
Initialize the SDK and wire the token provider to your Auth0 tenant.