<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/dynamicTypeSize(_:)-26aj0",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE15dynamicTypeSizeyQrqd__SXRd__AA07DynamiceF0O5BoundRtd__lF"
  },
  "title" : "dynamicTypeSize(_:)"
}
-->

# dynamicTypeSize(_:)

Limits the Dynamic Type size within the view to the given range.

```
nonisolated func dynamicTypeSize<T>(_ range: T) -> some View where T : RangeExpression, T.Bound == DynamicTypeSize
```

## Parameters

`range`

The range of sizes that are allowed in this view.

## Return Value

A view that constrains the Dynamic Type size of this view
within the specified `range`.

## Discussion

As an example, you can constrain the maximum Dynamic Type size in
`ContentView` to be no larger than `DynamicTypeSize/large`:

```
ContentView()
    .dynamicTypeSize(...DynamicTypeSize.large)
```

If the Dynamic Type size is limited to multiple ranges, the result is
their intersection:

```
ContentView() // Dynamic Type sizes are from .small to .large
    .dynamicTypeSize(.small...)
    .dynamicTypeSize(...DynamicTypeSize.large)
```

A specific Dynamic Type size can still be set after a range is applied:

```
ContentView() // Dynamic Type size is .xLarge
    .dynamicTypeSize(.xLarge)
    .dynamicTypeSize(...DynamicTypeSize.large)
```

When limiting the Dynamic Type size, consider if adding a
large content view with `View/accessibilityShowsLargeContentViewer()`
would be appropriate.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)