Expo UI and Router for iOSExpo SDK 57 and later, iOS only
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

You can add dynamicTypeSize to any view. It changes what you see on 35 of the 39 components.

No visible effect

These components accept it, but you see no change.

ComponentWhy nothing happens
SpacerIt changes only text and SF Symbols, and Spacer shows neither.
DividerIt changes only text and SF Symbols, and Divider shows neither.
SliderIt changes only text and SF Symbols, and Slider shows neither.
AccessoryWidgetBackgroundIt changes only text and SF Symbols, and AccessoryWidgetBackground shows neither.

Sources

The original Expo docs for this page:

On this page