MudBlazor theming, dialog patterns, snackbar integration, and common component usage for control panel applications. Trigger: MudBlazor, theme, dialog, snackbar, expansion panel, card.
From dotnet-ai-kitnpx claudepluginhub faysilalshareef/dotnet-ai-kit --plugin dotnet-ai-kitThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
MudExpansionPanels for collapsible detail sectionsMudCard for content groupingnamespace {Company}.{Domain}.ControlPanel.Configuration;
public static class ThemeConfiguration
{
public static MudTheme AppTheme => new()
{
PaletteLight = new PaletteLight
{
Primary = "#1976D2",
Secondary = "#424242",
AppbarBackground = "#1976D2",
Background = "#F5F5F5",
DrawerBackground = "#FFFFFF",
Success = "#4CAF50",
Error = "#F44336",
Warning = "#FF9800"
},
Typography = new Typography
{
Default = new DefaultTypography
{
FontFamily = ["Roboto", "Helvetica", "Arial", "sans-serif"]
}
},
LayoutProperties = new LayoutProperties
{
DrawerWidthLeft = "260px"
}
};
}
@inherits LayoutComponentBase
<MudThemeProvider Theme="ThemeConfiguration.AppTheme" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />
<MudLayout>
<MudAppBar Elevation="1">
<MudIconButton Icon="@Icons.Material.Filled.Menu"
Color="Color.Inherit"
OnClick="ToggleDrawer" />
<MudText Typo="Typo.h6">{Company} Control Panel</MudText>
</MudAppBar>
<MudDrawer @bind-Open="_drawerOpen" Elevation="2">
<NavMenu />
</MudDrawer>
<MudMainContent Class="pa-4">
@Body
</MudMainContent>
</MudLayout>
@* ConfirmDialog.razor *@
<MudDialog>
<DialogContent>
<MudText>@ContentText</MudText>
</DialogContent>
<DialogActions>
<MudButton OnClick="Cancel">Cancel</MudButton>
<MudButton Color="@Color" Variant="Variant.Filled"
OnClick="Submit">@ButtonText</MudButton>
</DialogActions>
</MudDialog>
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!;
[Parameter] public string ContentText { get; set; } = "";
[Parameter] public string ButtonText { get; set; } = "Confirm";
[Parameter] public Color Color { get; set; } = Color.Primary;
private void Cancel() => MudDialog.Cancel();
private void Submit() => MudDialog.Close(DialogResult.Ok(true));
}
private async Task DeleteOrder(Guid orderId)
{
var parameters = new DialogParameters<ConfirmDialog>
{
{ x => x.ContentText, "Are you sure you want to delete this order?" },
{ x => x.ButtonText, "Delete" },
{ x => x.Color, Color.Error }
};
var dialog = await DialogService.ShowAsync<ConfirmDialog>("Confirm", parameters);
var result = await dialog.Result;
if (!result.Canceled)
{
var response = await Gateway.Orders.DeleteAsync(orderId);
response.Switch(
onSuccess: _ =>
{
Snackbar.Add("Order deleted", Severity.Success);
await _dataGrid!.ReloadServerData();
},
onFailure: p => Snackbar.Add(p.Detail ?? "Delete failed", Severity.Error));
}
}
// Program.cs
services.AddMudServices(config =>
{
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomRight;
config.SnackbarConfiguration.PreventDuplicates = false;
config.SnackbarConfiguration.NewestOnTop = true;
config.SnackbarConfiguration.ShowCloseIcon = true;
config.SnackbarConfiguration.VisibleStateDuration = 5000;
config.SnackbarConfiguration.SnackbarVariant = Variant.Filled;
});
<MudExpansionPanels MultiExpansion="true">
<MudExpansionPanel Text="Order Details" IsInitiallyExpanded="true">
<MudSimpleTable Dense="true">
<tbody>
<tr><td>Customer</td><td>@_order.CustomerName</td></tr>
<tr><td>Total</td><td>@_order.Total.ToString("C2")</td></tr>
<tr><td>Status</td><td><MudChip T="string" Color="StatusColor">@_order.Status</MudChip></td></tr>
</tbody>
</MudSimpleTable>
</MudExpansionPanel>
<MudExpansionPanel Text="Order Items">
<MudTable Items="_order.Items" Dense="true" Hover="true">
<HeaderContent>
<MudTh>Product</MudTh>
<MudTh>Qty</MudTh>
<MudTh>Price</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd>@context.ProductName</MudTd>
<MudTd>@context.Quantity</MudTd>
<MudTd>@context.UnitPrice.ToString("C2")</MudTd>
</RowTemplate>
</MudTable>
</MudExpansionPanel>
</MudExpansionPanels>
| Anti-Pattern | Correct Approach |
|---|---|
| Inline colors and styles | Use MudTheme for consistent theming |
| Alert boxes for notifications | Use MudSnackbar |
| Custom modal implementation | Use MudDialog service |
| Missing loading indicators | Use MudProgressCircular/Linear |
# Find MudBlazor theme
grep -r "MudTheme\|PaletteLight" --include="*.cs" src/ControlPanel/
# Find dialog service usage
grep -r "DialogService.Show" --include="*.razor" src/ControlPanel/
# Find snackbar configuration
grep -r "AddMudServices\|SnackbarConfiguration" --include="*.cs" src/ControlPanel/
NavMenu for new pages