How theming works
Universal Components for iOS use a SwiftUI@Environment property wrapper theme. Apply the .auth0Theme(_:) modifier to any SwiftUI view. Every child component renders the injected Auth0Theme automatically.
Zero configuration
If you do not configure a theme, Universal Components for iOS render the Auth0 default theme. The following example displays theMyAccountAuthMethodsView component 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 iOS render every other token using the Auth0 default theme. The following example overrides only the primary background and text colors:Configure a full brand theme
Provide your own branding theme that implements the three color category properties, then wire them into anAuth0ColorTokens container:
Read the theme in your own views
Access the@Environment(\.auth0Theme) property wrapper to apply the same tokens in any Swift view:
Token reference
Colors — Auth0ColorTokens
Colors — Auth0ColorTokens
Colors are split across three focused protocols:
Auth0BackgroundColorTokens, Auth0TextColorTokens, and Auth0BorderColorTokens. These are aggregated into the Auth0ColorTokens protocol.All color assets are adaptive. The asset catalog handles light and dark mode automatically.Background primaryBackground layers
Background feedback
Text content
Text on color surfaces
Border
Typography — Auth0TypographyTokens
Typography — Auth0TypographyTokens
Each token is an
Auth0TextStyle bundling font, tracking, and lineSpacing. Apply them using the .auth0TextStyle(_:) view modifier.If typeface
Inter is not bundled in the host application, SwiftUI uses the SF Pro typeface automatically.Spacing — Auth0SpacingTokens
Spacing — Auth0SpacingTokens
Spacing defaults to a
4 pt grid. Use the token name in design handoffs to customize spacing, not the raw pixel value.Radius — Auth0RadiusTokens
Radius — Auth0RadiusTokens
Sizes — Auth0SizeTokens
Sizes — Auth0SizeTokens
Learn more
Install the iOS SDK
Platform prerequisites and installation for iOS.
Build a Self-Service Account Security Interface
Initialize the SDK and wire the token provider to your Auth0 tenant.