# Angular Chat Suggested Actions

The suggested actions appear as selectable options directly on specific messages. Use them to provide quick reply options or actions like opening external URLs.

Actions are hardcoded based on the user's input for demonstration purposes.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/conversational-ui/chat/suggested-actions/overview/source.txt)

To add suggested actions to a message, set the [`suggestedActions`](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/api/message#suggestedactions) property of the [`Message`](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/api/message#message) interface to an array of [`Action`](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/api/action#action) objects. Each action includes a value, optional title, and action type for different interaction behaviors.
The action types include:

* `reply`—Inserts the action value into the message input area for quick sending.
* `openUrl`—Opens the specified URL in a new browser tab when clicked.
* `call`—Initiates a phone call to the specified number (on supported devices).

```TS
public messages: Message[] = [
    {
        id: guid(),
        text: 'This is a test message?',
        suggestedActions: [
            { value: 'Nice one!', type: 'reply' },
            { value: 'Thank you.', type: 'reply' },
            {
                value: 'https://www.telerik.com/kendo-angular-ui',
                type: 'openUrl',
                title: 'Kendo UI for Angular'
            }
        ]
    }
];
```

When a user clicks a suggested action button, the component fires the [`executeAction`](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/api/chatcomponent#executeaction) event. The event returns an [`ExecuteActionEvent`](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/api/executeactionevent) object as an argument. Handle the event to respond to each action as needed.

## Actions Layout

By default, suggested actions are displayed in a horizontal layout below the message. If the number of actions exceeds the available width, you can scroll them using touchpad or `Shift` with Mouse Wheel.

You can change the actions layout behavior using the [`quickActionsLayout`](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/api/chatcomponent#quickactionslayout) input property and choose between `scrollbuttons` and `wrap` options.

The following example demonstrates the available layout options for the suggested actions.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/conversational-ui/chat/suggested-actions/layout/source.txt)

## Suggested Links

* [Predefined Suggestions](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/chat/quick-actions/predefined-suggestions)
* [Attachments](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/chat/attachments)
* [Message Templates](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/chat/message-templates)
* [Keyboard Navigation](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/chat/keyboard-navigation)
* [API Reference of the Chat](https://www.telerik.com/kendo-angular-ui/components/conversational-ui/api)
