AutoScroller

A component that automatically scrolls itself to the bottom as its content grows.

Basic example

1import { Answer, AutoScroller } from '@markprompt/react';
2
3function Example() {
4  return (
5    <AutoScroller className="MarkpromptAnswer">
6      <Answer />
7    </AutoScroller>
8  );
9}

Component API

PropTypeDescription
autoScrollboolean

Whether or not to enable automatic scrolling. Default: true.

scrollBehaviorScrollBehavior

The behaviour to use for scrolling. Default: 'smooth'.

scrollTriggerunknown

The element scrolls when this prop changes, unless scroll lock is enabled.

discreteScrollTriggernumber

The element scrolls when this prop changes, overriding scroll lock. Default: number.