Created
September 30, 2020 23:45
-
-
Save xakpc/093c85494c623954107ea7cfc8b88dd6 to your computer and use it in GitHub Desktop.
Card template for Blazor Bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="card @Class" @attributes="InputAttributes"> | |
@if (Title != null) | |
{ | |
<div class="card-header"> | |
<h5 class="card-title">@Title</h5> | |
</div> | |
} | |
<div class="card-body"> | |
@ChildContent | |
</div> | |
@if (Footer != null) | |
{ | |
<div class="card-footer text-muted"> | |
@Footer | |
</div> | |
} | |
</div> | |
@code { | |
[Parameter] | |
public string Class { get; set; } = "mb-3"; | |
[Parameter] | |
public RenderFragment ChildContent { get; set; } | |
[Parameter] | |
public RenderFragment Body | |
{ | |
get => ChildContent; | |
set => ChildContent = value; | |
} | |
[Parameter] | |
public RenderFragment Footer { get; set; } | |
[Parameter] | |
public string Title { get; set; } | |
[Parameter(CaptureUnmatchedValues = true)] | |
public Dictionary<string, object> InputAttributes { get; set; } = new Dictionary<string, object>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment