# .NET MAUI Chat Suggested Actions

The `RadChat` control enables you to add suggestions for the users. You can achieve this by adding `SuggestedActionsItem` instances to the `Items` collection of `RadChat`.

### Adding the Suggested Actions

The following example demonstrates how to create and set up a `SuggestedActionsItem`:

```C#
this.chat.Items.Add(new TextMessage { Text = "Hello" });
this.chat.Items.Add(new TextMessage { Text = "Hi", Author = this.chat.Author });
this.chat.Items.Add(new TextMessage { Text = "How can I help you?" });
this.chat.Items.Add(new TextMessage { Text = "I need help with buying some tickets.", Author = this.chat.Author });
this.chat.Items.Add(new TimeBreak() { Text = "Last read (Time Break)" });
this.chat.Items.Add(new TextMessage { Text = "Here's a list of possible actions:" });

var suggestedActionsItem = new SuggestedActionsItem();
suggestedActionsItem.Actions = this.GetSuggestedActions(suggestedActionsItem);
this.chat.Items.Add(suggestedActionsItem);
```

Then, the `GetSuggestedActions` method populates the `Actions` property with a collection of `SuggestedAction` items:

```C#
private ICollection<SuggestedAction> GetSuggestedActions(SuggestedActionsItem suggestedActionsItem)
{
    var actions = new List<SuggestedAction>();

    for (int i = 0; i < 5; i++)
    {
        int actionIndex = i;
        actions.Add(new SuggestedAction
        {
            Text = "Action " + i,
            Command = new Command(() =>
            {
                this.chat.Items.Remove(suggestedActionsItem);
                this.chat.Items.Add(new TextMessage { Author = this.chat.Author, Text = "Action " + actionIndex });
            }),
        });
    }
    return actions;
}
```

> caption `RadChat` with suggested actions

![Telerik UI for .NET MAUI Chat showing suggested action buttons labeled Action 0 through Action 4](https://www.telerik.com/maui-ui/documentation/assets/e678c503835bbc77ae8f29bd575415ca/chat-suggested-actions.png)

## See Also

* [Commands](https://www.telerik.com/maui-ui/documentation/controls/chat/commands)
