Files
decePubClient/Components/Daisy/DataInput/DLabel.razor
T

22 lines
766 B
Plaintext
Raw Normal View History

@inherits DComponentBase
@* daisyUI Label: https://daisyui.com/components/label/ . By default a span.label holding ChildContent, for a DInput or
DSelect Prefix/Suffix or a fieldset. Floating renders label.floating-label around the field in ChildContent, with
Text as the label that floats above it once the field has focus or a value. *@
@if (Floating)
{
<label @attributes="AdditionalAttributes" class="@Cx("floating-label", Class)">
@ChildContent
<span>@Text</span>
</label>
}
else
{
<span @attributes="AdditionalAttributes" class="@Cx("label", Class)">@(Text)@ChildContent</span>
}
@code {
[Parameter] public RenderFragment ChildContent { get; set; }
[Parameter] public string Text { get; set; }
[Parameter] public bool Floating { get; set; }
}