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

# customAttribute(_:)

Adds a custom attribute to the text view.

## Declaration

```swift
func customAttribute<T>(_ value: T) -> Text where T : TextAttribute
```

## Parameters

- `value`: The attribute to attach.

## Return Value

Return Value A version of the text view with value attached.

## Discussion

Discussion Only one attribute of each type may be attached to each text view, with inner attributes taking precedence.
