---
title: "fontWeight(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/text/fontweight(_:)"
---

# fontWeight(_:)

Sets the font weight of the text.

## Declaration

```swift
nonisolated func fontWeight(_ weight: Font.Weight?) -> Text
```

## Parameters

- `weight`: One of the available font weights.

## Return Value

Return Value Text that uses the font weight you specify.

## See Also

### Choosing a font

- [font(_:)](swiftui/text/font(_:).md)
- [fontDesign(_:)](swiftui/text/fontdesign(_:).md)
- [fontWidth(_:)](swiftui/text/fontwidth(_:).md)
