<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/fontWeight(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE10fontWeightyQrAA4FontV0E0VSgF"
  },
  "title" : "fontWeight(_:)"
}
-->

# fontWeight(_:)

Sets the font weight of the text in this view.

```
nonisolated func fontWeight(_ weight: Font.Weight?) -> some View
```

## Parameters

`weight`

One of the available font weights.
Providing `nil` removes the effect of any font weight
modifier applied higher in the view hierarchy.

## Return Value

A view that uses the font weight you specify.

---

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)