Zum Inhalt springen
NAVIGATION · FREE

Anchor

Anchor gehört zu RayCraft Free.

Beispiel

<div style="display:flex;align-items:flex-start;gap:1.5rem">
    <div style="flex:1;min-width:0">
        @foreach (var section in new[] { "Intro", "Setup", "Usage", "Extras" })
        {
            <h3 id="anchor-@section.ToLowerInvariant()">@section</h3>
            <p style="min-height:9rem">Text of the @section section. Scroll the page: the matching link is highlighted.</p>
        }
    </div>
    <Anchor Links="_links" Offset="120" />
</div>

@code {
    private readonly AnchorLink[] _links =
    [
        new("anchor-intro", "Introduction"),
        new("anchor-setup", "Setup"),
        new("anchor-usage", "Usage", [new("anchor-extras", "Extras")])
    ];
}

Ein kurzes Fragment. Fügen Sie @using RayCraft.Blazor.Components zu Ihrer Seite hinzu und nutzen Sie einen interaktiven Render-Modus.

In RayCraft Free enthalten. Funktionierende Beispiele finden Sie im GitHub-Repository (MIT); es enthält Beispiel- und Democode, nicht den Code der Bibliothek.

Alle Steuerelemente ยท Dokumentation