mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-07-08 18:16:08 +00:00
* Add Fab and FabMenu components --------- Co-authored-by: Atanas Korchev <akorchev@gmail.com>
45 lines
1.7 KiB
Plaintext
45 lines
1.7 KiB
Plaintext
@inject NotificationService NotificationService
|
|
|
|
<RadzenLayout style="position: relative; grid-template-areas: 'rz-header rz-header' 'rz-sidebar rz-body'">
|
|
<RadzenHeader>
|
|
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0">
|
|
<RadzenSidebarToggle Click="@(() => sidebarExpanded = !sidebarExpanded)" />
|
|
<RadzenLabel Text="Header" />
|
|
</RadzenStack>
|
|
</RadzenHeader>
|
|
|
|
<!-- Place RadzenFabMenu component first or after the Header in RadzenLayout. -->
|
|
<RadzenFabMenu Direction="Radzen.FabMenuDirection.Start">
|
|
<RadzenFabMenuItem Icon="folder" Click=@(args => OnClick("Add Folder.")) />
|
|
<RadzenFabMenuItem Icon="chat" Click=@(args => OnClick("Add Message.")) />
|
|
<RadzenFabMenuItem Icon="article" Click=@(args => OnClick("Add Article.")) />
|
|
</RadzenFabMenu>
|
|
|
|
<RadzenSidebar Responsive="false" @bind-Expanded="@sidebarExpanded" style="position: absolute; z-index: 3">
|
|
<RadzenPanelMenu>
|
|
<RadzenPanelMenuItem Text="Home" Icon="home" />
|
|
<RadzenPanelMenuItem Text="Users" Icon="account_box" />
|
|
</RadzenPanelMenu>
|
|
<div class="rz-p-4">
|
|
Sidebar
|
|
</div>
|
|
</RadzenSidebar>
|
|
<RadzenBody>
|
|
<div class="rz-p-4">
|
|
Body
|
|
</div>
|
|
</RadzenBody>
|
|
@if (sidebarExpanded)
|
|
{
|
|
<div @onclick="@(() => sidebarExpanded = false)" class="rz-dialog-mask" style="position: absolute; z-index: 2"></div>
|
|
}
|
|
</RadzenLayout>
|
|
|
|
@code {
|
|
bool sidebarExpanded = false;
|
|
|
|
private void OnClick(string text)
|
|
{
|
|
NotificationService.Notify(new NotificationMessage { Severity = NotificationSeverity.Info, Summary = "FAB clicked", Detail = text });
|
|
}
|
|
} |