---
title: "modifier(_:)"
framework: developertoolssupport
role: symbol
role_heading: Type Method
path: "developertoolssupport/previewtrait/modifier(_:)"
---

# modifier(_:)

Attach a PreviewModifier to the preview.

## Declaration

```swift
@MainActor static func modifier(_ modifier: some PreviewModifier) -> PreviewTrait<T>
```

## Discussion

Discussion You can compose modifiers by passing more than one instance of this trait. Composed modifiers will be applied to the preview in order: the first modifier will apply to the body of the preview, the second modifier to the body of the first modifier, and so on.
