@page "/dev/context-menu-demo" @* Dev-only host page to live-verify the reusable ContextMenu component. *@ @attribute [Authorize(Policy = AdminUiPolicies.AuthenticatedRead)] @rendermode InteractiveServer ContextMenu demo ContextMenu demo Right-click the card below, or use the ⋯ button. Right-click me Last action: @_lastAction @code { private string _lastAction = "(none)"; private IReadOnlyList _items => new List { new() { Label = "Edit", Icon = "✏️", OnClick = () => Set("Edit") }, new() { Label = "Duplicate", Icon = "📄", OnClick = () => Set("Duplicate") }, ContextMenuItem.Separator(), new() { Label = "Delete", Icon = "🗑️", Disabled = true, OnClick = () => Set("Delete") }, }; private Task Set(string action) { _lastAction = action; return Task.CompletedTask; } }
Right-click the card below, or use the ⋯ button.
Last action: @_lastAction