Hoppa till innehållet
NAVIGERING · FREE

Anchor

Anchor ingår i RayCraft Free.

Exempel

<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")])
    ];
}

Ett kort utdrag. Lägg till @using RayCraft.Blazor.Components på din sida och använd ett interaktivt renderingsläge.

Ingår i RayCraft Free. Fungerande exempel finns i GitHub-arkiv (MIT); det innehåller exempel- och demokod, inte bibliotekets kod.

Alla kontroller ยท Dokumentation