1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<a href="@href" class="btn btn-primary" style="background-color: @(Color ?? "#1b6ec2");"> @ChildContent </a> @code { [Parameter] public string href { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } [Parameter] public string? Color { get; set; } }