Files
decePubClient/Components/Daisy/Feedback/DToast.razor
T

29 lines
874 B
Plaintext
Raw Normal View History

@inherits DComponentBase
@* daisyUI Toast: https://daisyui.com/components/toast/ . A fixed-position stack (ChildContent, usually DAlerts) in a
corner or edge of the viewport; End/Bottom is daisyUI's default and adds no class. *@
<div @attributes="AdditionalAttributes" class="@CssClass">
@ChildContent
</div>
@code {
[Parameter] public RenderFragment ChildContent { get; set; }
[Parameter] public DToastHorizontal Horizontal { get; set; }
[Parameter] public DToastVertical Vertical { get; set; }
string CssClass => Cx("toast", HorizontalClass, VerticalClass, Class);
string HorizontalClass => Horizontal switch
{
DToastHorizontal.Start => "toast-start",
DToastHorizontal.Center => "toast-center",
_ => null
};
string VerticalClass => Vertical switch
{
DToastVertical.Top => "toast-top",
DToastVertical.Middle => "toast-middle",
_ => null
};
}