Skip to main content
Auth0 Universal Components for iOS use a design token model. Visual properties such as colors, typography, spacing, corner radii, and component sizes are each expressed as a token that you can override without changes to your layouts. Universal Components ship with a default Auth0 theme. You can provide your own theme to match your brand.

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 the MyAccountAuthMethodsView 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:
The same applies to typography, spacing, radius, and size tokens. The following example overrides typography and button radius:

Configure a full brand theme

Provide your own branding theme that implements the three color category properties, then wire them into an Auth0ColorTokens 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 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 layersBackground feedbackText contentText on color surfacesBorder
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 defaults to a 4 pt grid. Use the token name in design handoffs to customize spacing, not the raw pixel value.

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.