Skip to main content
.dynamicTypeSize(size: DynamicTypeSize)
size
DynamicTypeSize
required
The dynamic type size to apply. See DynamicTypeSize for available values. Default system size is "large".

Support

Usage

Force a smaller text size

VStack([
    Text("Compact UI"),
    Text("Smaller text regardless of system setting")
])
    .dynamicTypeSize("small")

Force an accessibility size

Text("Large readable text")
    .dynamicTypeSize("xxxLarge")

Pin a header to a fixed size

Text("App Title")
    .font("largeTitle")
    .dynamicTypeSize("large")

Notes

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.

See Also