Table of Contents

Interface IScrollSpy

Namespace
MudBlazor
Assembly
MudBlazor.dll

Interface for spying on scroll events and managing scroll behavior for specified elements.

public interface IScrollSpy : IAsyncDisposable
Inherited Members
Extension Methods

Properties

CenteredSection

Gets the current position of the centered section.

string? CenteredSection { get; }

Property Value

string

Methods

ScrollToSection(string)

Centers the viewport to the DOM element with the given ID.

Task ScrollToSection(string id)

Parameters

id string

The ID of the DOM element that should be centered.

Returns

Task

A task that represents the asynchronous operation.

ScrollToSection(Uri)

Centers the viewport to the DOM element represented by the fragment inside the URI.

Task ScrollToSection(Uri uri)

Parameters

uri Uri

The URI which contains the fragment. If no fragment is present, it scrolls to the top of the page.

Returns

Task

A task that represents the asynchronous operation.

SetSectionAsActive(string)

Sets the section as active without scrolling. This can be used to initially set a value.

Task SetSectionAsActive(string id)

Parameters

id string

The ID of the section to set as active.

Returns

Task

A task that represents the asynchronous operation.

StartSpying(string, string)

Starts spying for scroll events for elements with the specified classes.

Task StartSpying(string containerSelector, string sectionClassSelector)

Parameters

containerSelector string

The CSS selector to identify the scroll container.

sectionClassSelector string

The CSS class (without .) to identify the section containers to spy on.

Returns

Task

A task that represents the asynchronous operation.

Events

ScrollSectionSectionCentered

Occurs when a scroll section is centered.

event EventHandler<ScrollSectionCenteredEventArgs>? ScrollSectionSectionCentered

Event Type

EventHandler<ScrollSectionCenteredEventArgs>