[]
        
(Showing Draft Content)

ScrollPageIntoViewOptions

Type Alias: ScrollPageIntoViewOptions

type ScrollPageIntoViewOptions = ScrollIntoViewOptions & object;

Options for scrolling the page into view, extending the DOM scroll options type.

Type declaration

behavior?

optional behavior: ScrollBehavior;

Determines whether scrolling is instant or animates smoothly. This option is a string which must take one of the following values:

  • 'smooth': scrolling should animate smoothly
  • 'instant': scrolling should happen instantly in a single jump
  • 'auto': scroll behavior is determined by the computed value of scroll-behavior

block?

optional block: ScrollLogicalPosition;

Defines vertical alignment. One of start, center, end, or nearest. Defaults to start.

inline?

optional inline: ScrollLogicalPosition;

Defines horizontal alignment. One of start, center, end, or nearest. Defaults to nearest.

scrollMode?

optional scrollMode: "always" | "if-needed";

Scroll mode property. Set to 'if-needed' if you don't want to scroll when the page is partially visible. Defaults to 'if-needed'.

visibilityThreshold?

optional visibilityThreshold: number;

Sets the percentage of page visibility that triggers scrolling into view when the scrollMode property is set to 'if-needed'.