Table of Contents

Interface IScrollManager

Namespace
MudBlazor
Assembly
MudBlazor.dll

Provides methods for managing scroll behavior.

public interface IScrollManager
Extension Methods

Methods

LockScrollAsync(string, string)

Locks the scroll for the element matching the specified selector by adding a CSS class.

ValueTask LockScrollAsync(string selector = "body", string cssClass = "scroll-locked")

Parameters

selector string

The CSS selector of the element to lock scroll. Defaults to "body".

cssClass string

The CSS class to add to lock scroll. Defaults to "scroll-locked".

Returns

ValueTask

A task that represents the asynchronous operation.

ScrollIntoViewAsync(string?, ScrollBehavior)

Scrolls the element matching the specified selector into view.

ValueTask ScrollIntoViewAsync(string? selector, ScrollBehavior behavior)

Parameters

selector string

The CSS selector of the element to scroll into view.

behavior ScrollBehavior

The scroll behavior (e.g., smooth or auto).

Returns

ValueTask

A task that represents the asynchronous operation.

ScrollToAsync(string?, int, int, ScrollBehavior)

Scrolls to the specified position within the element with the given ID.

ValueTask ScrollToAsync(string? id, int left, int top, ScrollBehavior scrollBehavior)

Parameters

id string

The ID of the element to scroll.

left int

The horizontal scroll position.

top int

The vertical scroll position.

scrollBehavior ScrollBehavior

The scroll behavior (e.g., smooth or auto).

Returns

ValueTask

A task that represents the asynchronous operation.

ScrollToBottomAsync(string, ScrollBehavior)

Scrolls to the bottom of the element with the given ID.

ValueTask ScrollToBottomAsync(string elementId, ScrollBehavior scrollBehavior = ScrollBehavior.Auto)

Parameters

elementId string

The ID of the element to scroll.

scrollBehavior ScrollBehavior

The scroll behavior (e.g., smooth or auto). Defaults to auto.

Returns

ValueTask

A task that represents the asynchronous operation.

ScrollToListItemAsync(string)

Scrolls to the list item element with the given ID.

ValueTask ScrollToListItemAsync(string elementId)

Parameters

elementId string

The ID of the list item element to scroll.

Returns

ValueTask

A task that represents the asynchronous operation.

ScrollToTopAsync(string?, ScrollBehavior)

Scrolls to the top of the element with the given ID.

ValueTask ScrollToTopAsync(string? id, ScrollBehavior scrollBehavior = ScrollBehavior.Auto)

Parameters

id string

The ID of the element to scroll.

scrollBehavior ScrollBehavior

The scroll behavior (e.g., smooth or auto). Defaults to auto.

Returns

ValueTask

A task that represents the asynchronous operation.

ScrollToYearAsync(string)

Scrolls to the year element with the given ID.

ValueTask ScrollToYearAsync(string elementId)

Parameters

elementId string

The ID of the year element to scroll.

Returns

ValueTask

A task that represents the asynchronous operation.

UnlockScrollAsync(string, string)

Unlocks the scroll for the element matching the specified selector by removing a CSS class.

ValueTask UnlockScrollAsync(string selector = "body", string cssClass = "scroll-locked")

Parameters

selector string

The CSS selector of the element to unlock scroll. Defaults to "body".

cssClass string

The CSS class to remove to unlock scroll. Defaults to "scroll-locked".

Returns

ValueTask

A task that represents the asynchronous operation.