<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TipKit",
  "identifier" : "/documentation/TipKit/TipViewStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "TipKit"
    ],
    "preciseIdentifier" : "s:6TipKit0A9ViewStyleP"
  },
  "title" : "TipViewStyle"
}
-->

# TipViewStyle

A type that applies custom appearance to all tips within a view hierarchy.

```
@MainActor @preconcurrency protocol TipViewStyle
```

## Overview

To configure the current style for tips in a view hierarchy, use the <doc://com.apple.documentation/documentation/SwiftUI/View/tipViewStyle(_:)> modifier and specify a type that conforms to `TipViewStyle`.

![An image of a tip view with a custom style.](images/com.apple.TipKit/tipviewstyle_headline-style@2x.png)

Customize the layout and style of your tips by creating a custom `TipViewStyle`:

```swift
struct HeadlineTipViewStyle: TipViewStyle {
    func makeBody(configuration: TipViewStyle.Configuration) -> some View {
        VStack(alignment: .leading) {
            HStack {
                Text("TIP").font(.system(.headline).smallCaps())
                Spacer()
                Button(action: { configuration.tip.invalidate(reason: .tipClosed) }) {
                    Image(systemName: "xmark").scaledToFit()
                }
            }

            Divider().frame(height: 1.0)

            HStack(alignment: .top) {
                configuration.image?
                    .resizable()
                    .aspectRatio(contentMode: .fit)
                    .frame(width: 48.0, height: 48.0)

                VStack(alignment: .leading, spacing: 8.0) {
                    configuration.title?.font(.headline)
                    configuration.message?.font(.subheadline)

                    ForEach(configuration.actions) { action in
                        Button(action: action.handler) {
                            action.label().foregroundStyle(.blue)
                        }
                    }
                }
            }
        }
    }
}
```

Use the <doc://com.apple.documentation/documentation/SwiftUI/View/tipViewStyle(_:)> modifier to apply your style to all tips within a view hierarchy:

```swift
struct AddWorkoutView: View {
    var body: some View {
        VStack {
            TipView(AddWorkoutTip())
                .tipViewStyle(HeadlineTipViewStyle())

            Text("Workout Samples")
            WorkoutSampleList()
        }
    }
}
```

For UIKit and AppKit apps, the `viewStyle` property can be used for specifying a custom `TipViewStyle`:

```swift
let addWorkoutTipView = TipUIView(AddWorkoutTip())
addWorkoutTipView.viewStyle = HeadlineTipViewStyle()
addSubview(addWorkoutTipView)
```

## Topics

### Associated Types

[`associatedtype Body : View`](/documentation/TipKit/TipViewStyle/Body)

The user interface element of the tip.

### Instance Methods

[`func makeBody(configuration: Self.Configuration) -> Self.Body`](/documentation/TipKit/TipViewStyle/makeBody(configuration:))

A builder that makes the body of the tip view based on a style configuration.

### Type Aliases

[`typealias Configuration`](/documentation/TipKit/TipViewStyle/Configuration)

The tip style’s configuration.

### Type Properties

[`static var miniTip: MiniTipViewStyle`](/documentation/TipKit/TipViewStyle/miniTip)

The default style for a tip view.

## Relationships

### Conforming Types

[`MiniTipViewStyle`](/documentation/TipKit/MiniTipViewStyle)

---

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)