Dynamic Type Support
Dynamic Type Support
Dynamic Type is Apple’s accessibility feature that allows users to adjust text size across iOS applications. Supporting Dynamic Type means application text scales proportionally based on user-selected content size preferences, ranging from extra small to accessibility extra extra extra large. Design systems targeting iOS must ensure components support Dynamic Type for accessibility compliance.
What Is Dynamic Type Support
Dynamic Type provides user-controlled text scaling across iOS. Users select their preferred content size in Settings, choosing from seven default sizes or five additional accessibility sizes. Applications supporting Dynamic Type adjust their typography automatically based on this preference.
iOS system text styles (.body, .headline, .caption, etc.) automatically support Dynamic Type. Text using these styles scales appropriately without additional developer effort. Custom fonts require explicit implementation using UIFontMetrics to participate in Dynamic Type scaling.
Design systems must ensure all components accommodate Dynamic Type. Layouts must remain functional when text grows significantly larger. Truncation and scrolling strategies must handle text that no longer fits designed spaces.
How Dynamic Type Support Works
System text styles provide automatic Dynamic Type support. Each style has a default size at the default content size setting, with defined scaling behavior across all content size categories.
Dynamic Type Content Size Categories:
Default Sizes:
- Extra Small
- Small
- Medium
- Large (Default)
- Extra Large
- Extra Extra Large
- Extra Extra Extra Large
Accessibility Sizes:
- Accessibility Medium
- Accessibility Large
- Accessibility Extra Large
- Accessibility Extra Extra Large
- Accessibility Extra Extra Extra Large
UIFontMetrics for Custom Fonts:
// Swift Example
let customFont = UIFont(name: "CustomFont", size: 17)!
let scaledFont = UIFontMetrics(forTextStyle: .body)
.scaledFont(for: customFont)
// SwiftUI
Text("Hello")
.font(.custom("CustomFont", size: 17, relativeTo: .body))
UIFontMetrics enables custom fonts to scale with Dynamic Type. The API takes a base font and text style, returning a font that scales proportionally to the text style’s Dynamic Type behavior. SwiftUI’s .custom font modifier with relativeTo parameter provides equivalent functionality.
Layout adaptation handles text that grows beyond original sizes. Flexible layouts using Auto Layout constraints accommodate growth. Scrollable regions prevent text from being clipped. Truncation serves as last resort when scrolling is inappropriate.
Content size change notifications enable runtime response to Dynamic Type changes. Applications can observe UIContentSizeCategory.didChangeNotification to update custom layouts when users change text size without restarting the application.
Key Considerations
- All text should scale with Dynamic Type for accessibility
- Layouts must accommodate significantly larger text
- Minimum touch targets must remain regardless of text size
- Images and icons may need scaling alongside text
- Testing requires checking all content size categories
- Large accessibility sizes require layout verification
Common Questions
How should design systems specify Dynamic Type behavior?
Typography specifications should include text style mappings. Each design system text style should map to an iOS text style for scaling behavior. “Body” maps to .body, “Caption” maps to .caption, etc.
Maximum and minimum size constraints may be necessary. While text should generally scale freely, some contexts might need limits. Constraints should be documented and justified.
Layout specifications should indicate how components adapt. Documentation should describe behavior at large accessibility sizes, including whether components scroll, truncate, or adapt layout.
Testing requirements should include Dynamic Type verification. Quality assurance should check components at multiple content size categories, particularly large accessibility sizes.
What happens when Dynamic Type text does not fit?
Scrolling accommodates text that grows beyond available space. ScrollViews allow users to access all content even when it exceeds the viewport.
Layout adaptation changes component structure. A horizontal arrangement might become vertical at large sizes. Multiple columns might become single column.
Truncation serves as last resort. When scrolling and adaptation are inappropriate, text truncates with ellipsis. Users can typically access full text through other means (tapping for detail view).
Minimum touch targets must be maintained. Even if text shrinks at extra small settings, interactive areas must meet minimum size requirements for accessibility.
How do teams test Dynamic Type support?
Accessibility Inspector in Xcode allows testing Dynamic Type without changing device settings. The inspector can override content size category for testing.
Device Settings changes test actual behavior. Testing should include largest accessibility sizes where layouts are most challenged.
Automated testing can verify text scaling. Snapshot tests at multiple content size categories catch regressions.
Real device testing with actual accessibility users provides the most meaningful validation. Users who rely on large text reveal issues that developers may overlook.
Summary
Dynamic Type support enables iOS text to scale based on user accessibility preferences. Design systems must ensure all components use system text styles or custom fonts with UIFontMetrics. Layouts must accommodate significantly larger text through scrolling, adaptation, or constrained truncation. Testing across content size categories, especially large accessibility sizes, validates proper Dynamic Type implementation.
Buoy scans your codebase for design system inconsistencies before they ship
Detect Design Drift Free