---
title: TipViewStyle
framework: tipkit
role: symbol
role_heading: Protocol
path: tipkit/tipviewstyle
---

# TipViewStyle

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

## Declaration

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

## Overview

Overview To configure the current style for tips in a view hierarchy, use the tipViewStyle(_:) modifier and specify a type that conforms to TipViewStyle.

Customize the layout and style of your tips by creating a custom TipViewStyle: 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 tipViewStyle(_:) modifier to apply your style to all tips within a view hierarchy: 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: let addWorkoutTipView = TipUIView(AddWorkoutTip()) addWorkoutTipView.viewStyle = HeadlineTipViewStyle() addSubview(addWorkoutTipView)

## Topics

### Associated Types

- [Body](tipkit/tipviewstyle/body.md)

### Instance Methods

- [makeBody(configuration:)](tipkit/tipviewstyle/makebody(configuration:).md)

### Type Aliases

- [TipViewStyle.Configuration](tipkit/tipviewstyle/configuration.md)

### Type Properties

- [miniTip](tipkit/tipviewstyle/minitip.md)

## Relationships

### Conforming Types

- [MiniTipViewStyle](tipkit/minitipviewstyle.md)

## See Also

### View Style

- [tipViewStyle(_:)](swiftui/view/tipviewstyle(_:).md)
- [TipViewStyleConfiguration](tipkit/tipviewstyleconfiguration.md)
- [MiniTipViewStyle](tipkit/minitipviewstyle.md)
