decePubClient/Components/DropdownButton.razor
Eugenio Chiodo ba4a4b14c8 Saving
2022-02-14 01:51:37 +01:00

24 lines
657 B
Plaintext

<div class="dropdown @CssDirection @(IsOpen ? "is-active" : default)">
<div class="dropdown-trigger">
@DropdownTrigger
</div>
<div class="dropdown-menu min-w-full pt-2" id="dropdown-menu6" role="menu">
<div class="dropdown-content text-right background neomorph is-nxsmall rounded-lg">
@DropdownContent
</div>
</div>
</div>
@code {
[Parameter] public RenderFragment DropdownTrigger { get; set; }
[Parameter] public RenderFragment DropdownContent { get; set; }
[Parameter] public bool IsOpen { get; set; } = false;
[Parameter] public string CssDirection { get; set; } = "is-right";
void OpenCloseOptions()
{
IsOpen = !IsOpen;
}
}