Expo UI and Router for iOS
Modifiers

dynamicTypeSize

Sets or constrains the Dynamic Type size within the view, overriding the value inherited from the system.

dynamicTypeSize(size)

Overload #1

ParameterType
sizeDynamicTypeSizeValue

Sets or constrains the Dynamic Type size within the view, overriding the value inherited from the system.

Four variants matching SwiftUI's dynamicTypeSize(_:):

  • dynamicTypeSize('large') — fixes the Dynamic Type size to a single value
  • dynamicTypeSize({ max: 'accessibility3' }) — caps growth at a ceiling (...accessibility3)
  • dynamicTypeSize({ min: 'large' }) — sets a floor (large...)
  • dynamicTypeSize({ min: 'large', max: 'accessibility3' }) — clamps to a range (large...accessibility3)

min and max are independent: pass either or both. Set it on a <Host> to cascade the constraint to every descendant through the SwiftUI environment. Keep min at or below max, or the range traps natively, like SwiftUI. Per Apple's guidance, prefer capping at an accessibility size over disabling Dynamic Type entirely.

Returns: ModifierConfig

See: Official SwiftUI documentation.

Example

// Cap how large text in a tight layout can grow
<Host modifiers={[dynamicTypeSize({ max: 'accessibility3' })]}>...</Host>

dynamicTypeSize(range)

Overload #2

ParameterType
range{ max: DynamicTypeSizeValue, min: DynamicTypeSizeValue }

Sets or constrains the Dynamic Type size within the view, overriding the value inherited from the system.

Four variants matching SwiftUI's dynamicTypeSize(_:):

  • dynamicTypeSize('large') — fixes the Dynamic Type size to a single value
  • dynamicTypeSize({ max: 'accessibility3' }) — caps growth at a ceiling (...accessibility3)
  • dynamicTypeSize({ min: 'large' }) — sets a floor (large...)
  • dynamicTypeSize({ min: 'large', max: 'accessibility3' }) — clamps to a range (large...accessibility3)

min and max are independent: pass either or both. Set it on a <Host> to cascade the constraint to every descendant through the SwiftUI environment. Keep min at or below max, or the range traps natively, like SwiftUI. Per Apple's guidance, prefer capping at an accessibility size over disabling Dynamic Type entirely.

Returns: ModifierConfig

See: Official SwiftUI documentation.

Example

// Cap how large text in a tight layout can grow
<Host modifiers={[dynamicTypeSize({ max: 'accessibility3' })]}>...</Host>

Works with

This modifier works with any view. These components accept it:

Sources

The original Expo docs for this page:

On this page