# Chat AutoScroll Threshold

The Chat component supports the `autoScrollThreshold` configuration option to control when new incoming messages scroll the list to the bottom.

When users stay close enough to the bottom, the Chat keeps the latest message in view. When users scroll further away, the Chat preserves their reading position and displays the scroll-to-bottom action.

## Configuring AutoScroll Threshold

Set the threshold as percentage or pixels.

```dojo
<div id="chat"></div>

<script>
    $("#chat").kendoChat({
        authorId: "user",
        autoScrollThreshold: "50%"
    });
</script>
```

## Updating the Threshold at Runtime

To change the threshold after the component is initialized, call `setOptions` on the Chat instance and pass the new value.

```javascript
const chat = $("#chat").data("kendoChat");
chat.setOptions({
    autoScrollThreshold: "200px"
});
```

## Next Steps

* [Chat Overview](https://www.telerik.com/kendo-jquery-ui/documentation/controls/chat/overview)
* [Chat Adornments](https://www.telerik.com/kendo-jquery-ui/documentation/controls/chat/adornments)
* [AutoScroll Threshold Demo](https://demos.telerik.com/kendo-ui/chat/autoscroll-threshold)
* [Chat API Reference](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/chat)
