Skip to main content
These modifiers override system-level user preferences for a subtree of the view hierarchy. colorScheme forces light or dark appearance. dynamicTypeSize overrides the user’s preferred text size. Both should be used sparingly — respecting the user’s system settings is the right default for accessibility. Use these modifiers for small, scoped exceptions like an always-dark header or a fixed-size logo.

colorScheme

Forces a specific color scheme (light or dark) for a component and its descendants.
scheme
"light" | "dark"
required
The color scheme to apply to this component subtree.
This modifier overrides the system color scheme for the component and all of its descendants. It doesn’t affect siblings or ancestors. Use the environment modifier with the "colorScheme" key for the same effect. Force dark mode on a section
Force light mode on a card

dynamicTypeSize

Overrides the dynamic type size for a component and its descendants.
size
DynamicTypeSize
required
The dynamic type size to apply. See DynamicTypeSize for available values. Default system size is "large".
This modifier overrides the user’s system-wide Dynamic Type preference for the targeted component subtree. Use sparingly — respecting the user’s preferred text size is generally recommended for accessibility. Force a smaller text size
Force an accessibility size
Pin a header to a fixed size

See also