---
title: "dynamicTypeSize(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/dynamictypesize(_:)"
---

# dynamicTypeSize(_:)

Sets the Dynamic Type size within the view to the given value.

## Declaration

```swift
nonisolated func dynamicTypeSize(_ size: DynamicTypeSize) -> some View

```

## Parameters

- `size`: The size to set for this view.

## Return Value

Return Value A view that sets the Dynamic Type size to the specified size.

## Discussion

Discussion As an example, you can set a Dynamic Type size in ContentView to be DynamicTypeSize.xLarge (this can be useful in previews to see your content at a different size) like this: ContentView()     .dynamicTypeSize(.xLarge) If a Dynamic Type size range is applied after setting a value, the value is limited by that range: ContentView() // Dynamic Type size will be .large     .dynamicTypeSize(...DynamicTypeSize.large)     .dynamicTypeSize(.xLarge) When limiting the Dynamic Type size, consider if adding a large content view with accessibilityShowsLargeContentViewer() would be appropriate.

## See Also

### Adjusting text size

- [textScale(_:isEnabled:)](swiftui/view/textscale(_:isenabled:).md)
- [dynamicTypeSize](swiftui/environmentvalues/dynamictypesize.md)
- [DynamicTypeSize](swiftui/dynamictypesize.md)
- [ScaledMetric](swiftui/scaledmetric.md)
- [TextVariantPreference](swiftui/textvariantpreference.md)
- [FixedTextVariant](swiftui/fixedtextvariant.md)
- [SizeDependentTextVariant](swiftui/sizedependenttextvariant.md)
