---
title: SuggestedActionsView
framework: Suggested Actions
role: symbol
role_heading: Structure
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, visionOS 27.0+]
path: suggestedactions/suggestedactionsview
---

# SuggestedActionsView

A view that displays suggested actions for a message.

## Declaration

```swift
@MainActor struct SuggestedActionsView
```

## Overview

Overview The suggested actions view displays inline actions for a messaging app, next to a message, using context you provide. This view animates suggested actions as they become available. If no suggested actions are available, the view’s size is zero and remains zero until they become available. At size zero, a SuggestedActionsView doesn’t affect your surrounding layout. As a result, place the view for every message in a conversation. It doesn’t introduce gaps between messages if a message doesn’t have suggested actions. note: To display suggested actions, add the Suggested Actions entitlement to your app target. Customize the appearance To customize a SuggestedActionsView, apply standard SwiftUI view modifiers to change its appearance. Additionally, the view reads the following modifiers from its parent views: tint(_:), foregroundStyle(_:), font(_:) buttonBorderShape(_:) Generate suggested actions for future use To avoid showing a loading state when the view appears, call generate(message:previousMessages:) to let the Suggested Actions framework create suggested actions and cache them for future use. When you later initialize a SuggestedActionsView, the framework checks the id of cached suggested actions based on their messages’ id property. If it finds an id that matches the id of a new SuggestedActionsMessage, the system uses the already generated suggested action. The following example shows how an app might show a SuggestedActionsView with information about previous messages using a capsule border shape, blue tint, and the callout font style: SuggestedActionsView(     message: message.suggestedActionsMessage,     previousMessages: message.previousMessages         .suffix(SuggestedActionsMessage.previousMessagesLimit)         .map(\.suggestedActionsMessage) ) .buttonBorderShape(.capsule) .tint(.blue) .font(.callout)

## Topics

### Displaying suggested actions

- [init(message:previousMessages:)](suggestedactions/suggestedactionsview/init(message:previousmessages:).md)
- [generate(message:previousMessages:)](suggestedactions/suggestedactionsview/generate(message:previousmessages:).md)
- [SuggestedActionsMessage](suggestedactions/suggestedactionsmessage.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [View](swiftui/view.md)
