### Install Code Syntax Highlighting Package
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/README.md
Install the optional NuGet package for code syntax highlighting capabilities.
```bash
# Optional: Code syntax highlighting
dotnet add package CodeBeam.MudBlazor.Extensions.Code
```
--------------------------------
### Install QR Code Package
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/README.md
Install the optional NuGet package for QR code and barcode generation functionality.
```bash
# Optional: QR codes and barcodes
dotnet add package CodeBeam.MudBlazor.Extensions.Qr
```
--------------------------------
### Install Main MudBlazor Extensions Package
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Install the core MudBlazor Extensions NuGet package using the .NET CLI.
```bash
dotnet add package CodeBeam.MudBlazor.Extensions
```
--------------------------------
### Teleport Element Example
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/services.md
Example demonstrating how to use MudTeleportManager to move a div element to a target container.
```csharp
@inject MudTeleportManager TeleportManager
```
--------------------------------
### MudWatch for Value Changes
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/animation-special-components.md
Illustrates the MudWatch component, which monitors a specified value for changes. This example uses deep watching and includes a debounce delay before triggering a callback to handle the changes.
```csharp
@code {
Dictionary userData = new();
async Task OnUserDataChanged(object changedValue) {
// React to user data changes
await SaveUserData();
}
}
```
--------------------------------
### MudCodeViewer with Syntax Highlighting
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/animation-special-components.md
Example of using MudCodeViewer to display a C# code snippet with line numbers, header, and a copy button. The code snippet is defined within the component's @code block.
```csharp
@page "/code-viewer-demo"
@using MudExtensions
@code {
string codeSnippet = @"
public class Example
{
public void HelloWorld()
{
Console.WriteLine(\"Hello, World!\");
}
}
";
}
```
--------------------------------
### Development Build Configuration - launchSettings.json
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Configures development server settings, including enabling .NET run messages and specifying the environment. This file is used for debugging and local development.
```json
{
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7001;http://localhost:5001",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
```
--------------------------------
### Configure MudExtensions for Blazor Server
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Sets up MudExtensions services for a Blazor Server application. This is typically done in the Program.cs file.
```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents();
builder.Services.AddMudServices();
builder.Services.AddMudExtensions();
var app = builder.Build();
app.Run();
```
--------------------------------
### MudWheel Basic Usage
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Demonstrates how to use the MudWheel component to display and select items from a list. Ensure the 'MudExtensions' namespace is imported.
```csharp
@context
@code {
string selectedColor = "Red";
List colors = new() { "Red", "Blue", "Green", "Yellow" };
}
```
--------------------------------
### Configure MudExtensions for Blazor WebAssembly
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Sets up MudExtensions services for a Blazor WebAssembly application. This is typically done in the Program.cs file.
```csharp
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add("#app");
builder.Services.AddMudServices();
builder.Services.AddMudExtensions();
await builder.Build().RunAsync();
```
--------------------------------
### Using Open Iconic with Foundation Classes
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
Apply Foundation-compatible icon classes to span elements for displaying icons.
```html
```
--------------------------------
### MudGallery Component
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Illustrates the MudGallery component for displaying a collection of images with thumbnail navigation and lightbox features. Requires 'using MudExtensions;'.
```csharp
@code {
List imageUrls = new() {
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
"https://example.com/image3.jpg"
};
}
```
--------------------------------
### Service Registration for MudBlazor Extensions
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/README.md
Register the necessary services for MudBlazor and MudBlazor Extensions in your Program.cs file.
```csharp
using MudExtensions.Services;
builder.Services.AddMudServices();
builder.Services.AddMudExtensions();
```
--------------------------------
### Get CSS Property (Enum)
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/services.md
Retrieves the value of a CSS property for elements matching a class name using a CssProp enum. Returns the value or null if not found.
```csharp
Task GetCss(string? className, CssProp cssProp)
```
--------------------------------
### Register MudExtensions Services
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/README.md
Register the MudExtensions services in your Program.cs file. This is necessary to enable the library's features.
```csharp
using MudExtensions.Services;
builder.Services.AddMudExtensions();
```
--------------------------------
### MudLoading Component
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Demonstrates the basic usage of the MudLoading component to display a loading state with a circle loader.
```csharp
Your content here
@code {
bool isLoading = true;
}
```
--------------------------------
### Get CSS Property (String)
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/services.md
Retrieves the value of a CSS property for elements matching a class name using a string for the property name. Returns the value or null if not found.
```csharp
Task GetCss(string? className, string? cssPropName)
```
--------------------------------
### Handle MudSignaturePad Initialization and Image Saving
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/errors.md
Wait for OnAfterRenderAsync before interacting with the MudSignaturePad canvas. Ensure the canvas is not empty before calling GetImageAsync and use correct color formats for PenColor/BackgroundColor.
```csharp
protected override async Task OnAfterRenderAsync(bool firstRender) {
if (firstRender) {
// Canvas is now initialized
await Task.Delay(100); // Ensure DOM is ready
}
}
async Task SaveSignature() {
try {
var imageData = await signaturePad.GetImageAsync();
if (string.IsNullOrEmpty(imageData)) {
throw new InvalidOperationException("Signature is empty");
}
// Save imageData
}
catch (Exception ex) {
Snackbar.Add($"Error: {ex.Message}", Severity.Error);
}
}
```
--------------------------------
### Production Deployment - Minified CSS
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Links the minified CSS file for production use. Ensure this path is correct in your application's index.html or _Layout.cshtml.
```html
```
--------------------------------
### Multi-Selection with Search and Select All
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/picker-select-components.md
Demonstrates a multi-select dropdown with search functionality and a 'select all' option. Use when users need to select multiple tags from a predefined list.
```csharp
@context
@code {
HashSet selectedTags = new();
List availableTags = new() { "Important", "Urgent", "Low Priority" };
}
```
--------------------------------
### MudSplitter Component
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Demonstrates the MudSplitter component for creating resizable split panes in a layout. Requires 'using MudExtensions;'.
```csharp
Left Pane
Right Pane
```
--------------------------------
### Build (string list overload)
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/types.md
Generates CSS keyframes for single property animation using a list of string values.
```APIDOC
## Build (string list overload)
### Description
Generates CSS keyframes for single property animation.
### Method Signature
```csharp
public static string Build(int ticks, List values, string property, string defaultValue = "")
```
### Parameters
#### Path Parameters
- **ticks** (int) - Required - Number of keyframe steps
- **values** (List) - Required - Property values for each tick
- **property** (string) - Required - CSS property with `-val-` placeholder
- **defaultValue** (string) - Optional - Default value if not specified
### Returns
string - CSS keyframe declaration
### Example
```csharp
var keyframes = KeyframeBuilder.Build(
ticks: 3,
values: new List { "0px", "50px", "0px" },
property: "transform: translateX(-val-)"
);
// Result: "0%{ transform: translateX(0px) }50%{ transform: translateX(50px) }100%{ transform: translateX(0px) }"
```
```
--------------------------------
### MudListExtended Basic Usage
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/extended-utility-components.md
Demonstrates basic usage of MudListExtended with single item selection. Ensure 'using MudExtensions;' is present.
```razor
@context
@code {
List items = new() { "Item 1", "Item 2", "Item 3" };
string selectedItem;
}
```
--------------------------------
### SignaturePadOptions Class
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/types.md
Defines configuration options for customizing the behavior and appearance of the signature pad component.
```csharp
public class SignaturePadOptions
{
public float DotSize { get; set; }
public float MinWidth { get; set; }
public float MaxWidth { get; set; }
public float Throttle { get; set; }
public float Velocity { get; set; }
public float Acceleration { get; set; }
}
```
--------------------------------
### Production Deployment - Minified JavaScript
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Includes the minified JavaScript file for production use. Ensure this path is correct in your application's index.html or _Layout.cshtml.
```html
```
--------------------------------
### MudBarcode QR Code Generation
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/animation-special-components.md
Shows how to generate a QR code for a given URL using the MudBarcode component. Includes a text label below the QR code.
```csharp
Scan to visit product page
```
--------------------------------
### Including Open Iconic with Foundation
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
Link the Foundation-specific stylesheet to use Open Iconic with Foundation classes.
```html
```
--------------------------------
### Build (tuple list overload)
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/types.md
Generates CSS keyframes for two-property animation using a list of tuples.
```APIDOC
## Build (tuple list overload)
### Description
Generates CSS keyframes for two-property animation.
### Method Signature
```csharp
public static string Build(int ticks, List> values, string property, string defaultValue = "")
```
### Parameters
#### Path Parameters
- **ticks** (int) - Required - Number of keyframe steps
- **values** (List>) - Required - Pairs of property values for each tick
- **property** (string) - Required - CSS property with `-val1-` and `-val2-` placeholders
- **defaultValue** (string) - Optional - Default value if not specified
### Returns
string - CSS keyframe declaration
```
--------------------------------
### Move Element with MudTeleportManager
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Demonstrates how to use MudTeleportManager to move an HTML element to a specified portal root. Ensure MudTeleportManager is injected and the target element exists.
```csharp
@inject MudTeleportManager TeleportManager
Content
@code {
ElementReference elementRef;
async Task MoveElement() {
await TeleportManager.Teleport(elementRef, "#portal-root");
}
}
```
--------------------------------
### MudGallery
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Image gallery component with lightbox and thumbnail navigation. Supports fullscreen and zoom functionalities.
```APIDOC
## MudGallery
### Description
Image gallery component with lightbox and thumbnail navigation. Supports fullscreen and zoom functionalities.
### Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| Items | List | null | List of image URLs |
| SelectedIndex | int | 0 | Currently displayed image index |
| ShowThumbnails | bool | true | If true, displays thumbnail strip |
| ThumbnailHeight | int | 60 | Thumbnail height in pixels |
| AllowFullscreen | bool | true | If true, enables fullscreen mode |
| AllowZoom | bool | true | If true, enables image zoom |
| Class | string | null | CSS classes |
| Style | string | null | Inline CSS styles |
### Example Usage
```csharp
@code {
List imageUrls = new() {
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
"https://example.com/image3.jpg"
};
}
```
```
--------------------------------
### Font Selection with Preview
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/picker-select-components.md
A font picker component that allows users to select a font and see a live preview. Ideal for text styling options.
```csharp
This text uses the selected font
@code {
string selectedFont = "Arial";
}
```
--------------------------------
### Development Build Configuration - .csproj for SASS Compilation
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Includes the MudBlazor.SassCompiler package for development builds, enabling SCSS file compilation. This is conditionally applied for Debug configurations.
```xml
```
--------------------------------
### MudLoadingButton with Progress Indicator
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/README.md
Create a loading button that displays a progress indicator and text while an asynchronous operation is in progress.
```razor
@if (isLoading) {
Processing...
} else {
Click Me
}
```
--------------------------------
### Include MudExtensions CSS Files
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Add the main MudExtensions CSS and the optional MudCodeViewer CSS to your HTML head section.
```html
```
--------------------------------
### MudLoadingButton Component
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Shows how to use MudLoadingButton to display a loading spinner within a button when an action is in progress. Requires 'using MudExtensions;'.
```csharp
@if (isLoading)
{
Saving...
}
else
{
Save
}
@code {
bool isLoading;
async Task HandleClick() {
isLoading = true;
await Task.Delay(2000);
isLoading = false;
}
}
```
--------------------------------
### MudToggle with Labels
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/animation-special-components.md
Shows how to use the MudToggle component to create a custom switch with distinct labels for its checked and unchecked states. It also displays the current state using MudText.
```csharp
Current mode: @(isDarkMode ? "Dark" : "Light")
@code {
bool isDarkMode;
}
```
--------------------------------
### Register MudBlazor Extensions Services
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/errors.md
Ensure MudBlazor and MudExtensions services are registered in the DI container. This is typically done in Program.cs.
```csharp
builder.Services.AddMudServices();
builder.Services.AddMudExtensions(); // Registers all services
```
--------------------------------
### Using Open Iconic Standalone Classes
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
Apply default Open Iconic classes to span elements for displaying icons when not using a framework.
```html
```
--------------------------------
### Include MudBlazor Extensions CSS and JS
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/errors.md
Load the MudExtensions CSS and JavaScript files in the correct order in your HTML. This ensures that JavaScript interop functions are available.
```html
```
--------------------------------
### MudTypographyProvider
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/extended-utility-components.md
A utility component for applying the Material Design 3 typography system across child components.
```APIDOC
## MudTypographyProvider
### Description
Utility for applying Material Design 3 typography system.
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Parameters
- **FontFamily** (string) - null - Base font family
- **ChildContent** (RenderFragment) - null - Child components
```
--------------------------------
### Including Open Iconic Standalone
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
Link the default stylesheet for standalone use of Open Iconic icon font.
```html
```
--------------------------------
### MudRangeSlider Constraint Logic in C#
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/errors.md
Demonstrates the internal constraint logic for MudRangeSlider, showing how values are auto-corrected or clamped to adhere to MinDistance, Min, and Max constraints.
```csharp
// In MudRangeSlider logic
if (value + minDistance >= upperValue) {
value = upperValue - minDistance; // Auto-correct
}
if (value < slideableMin) {
value = slideableMin.Value; // Clamp to constraint
}
```
--------------------------------
### MudLoadingButton
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Button that displays loading state with spinner. Allows customization of variant, color, size, and click handling.
```APIDOC
## MudLoadingButton
### Description
Button that displays loading state with spinner. Allows customization of variant, color, size, and click handling.
### Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| Loading | bool | false | If true, shows loading spinner |
| Disabled | bool | false | If true, button is disabled |
| OnClick | EventCallback | — | Button click handler |
| Variant | Variant | Filled | Button variant (Filled, Outlined, Text) |
| Color | Color | Primary | Button color |
| Size | Size | Medium | Button size (Small, Medium, Large) |
| FullWidth | bool | false | If true, button spans full width |
| Class | string | null | CSS classes |
| ChildContent | RenderFragment | null | Button text/content |
### Example Usage
```csharp
@if (isLoading)
{
Saving...
}
else
{
Save
}
@code {
bool isLoading;
async Task HandleClick() {
isLoading = true;
await Task.Delay(2000);
isLoading = false;
}
}
```
```
--------------------------------
### Using Open Iconic with Bootstrap Classes
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
Apply Bootstrap-compatible icon classes to span elements for displaying icons.
```html
```
--------------------------------
### MudScrollbar Component
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/display-components.md
Shows how to apply a custom MudScrollbar to a scrollable container. Requires 'using MudExtensions;'.
```csharp
```
--------------------------------
### MudColorProvider
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/extended-utility-components.md
A utility component for managing the application's color theme, allowing selection and customization of colors.
```APIDOC
## MudColorProvider
### Description
Utility for managing application color theme.
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Parameters
- **SelectedColor** (string) - null - Current color (hex)
- **SelectedColorChanged** (EventCallback) - — - Fires when color changes
- **AllowCustom** (bool) - true - If true, allows custom color input
- **Columns** (int) - 6 - Grid columns for color palette
- **Class** (string) - null - CSS classes
```
--------------------------------
### Build CSS Keyframes (String List Overload)
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/types.md
Generates CSS keyframes for single property animations using a list of string values. Use this when animating a single CSS property.
```csharp
public static string Build(int ticks, List values, string property, string defaultValue = "")
```
```csharp
var keyframes = KeyframeBuilder.Build(
ticks: 3,
values: new List { "0px", "50px", "0px" },
property: "transform: translateX(-val-)"
);
// Result: "0%{ transform: translateX(0px) }50%{ transform: translateX(50px) }100%{ transform: translateX(0px) }"
```
--------------------------------
### Include MudExtensions JavaScript Files
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Add the main MudExtensions JavaScript and the optional MudCodeViewer JavaScript to the end of your HTML body section.
```html
```
--------------------------------
### Including Open Iconic with Bootstrap
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
Link the Bootstrap-specific stylesheet to use Open Iconic with Bootstrap classes.
```html
```
--------------------------------
### MudStepperExtended Basic Usage
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/extended-utility-components.md
Illustrates a basic multi-step form using MudStepperExtended with navigation buttons. Ensure 'using MudExtensions;' is present.
```razor
@ref="stepper"
Step 1: Personal InfoStep 2: AddressStep 3: ReviewReview your information stepper.PreviousStepAsync()">Back stepper.NextStepAsync()">Next
@code {
MudStepperExtended stepper;
int currentStep;
string name;
string address;
}
```
--------------------------------
### Build CSS Keyframes (Tuple List Overload)
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/types.md
Generates CSS keyframes for two-property animations using a list of tuples. Use this when animating two related CSS properties simultaneously.
```csharp
public static string Build(int ticks, List> values, string property, string defaultValue = "")
```
--------------------------------
### Update CSS Link Path
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/BreakingChanges.md
The path for the MudBlazor.Extensions CSS file has been updated. Replace the old link with the new one provided.
```html
```
--------------------------------
### MudTextM3
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/extended-utility-components.md
Implements Material Design 3 typography styles for text elements.
```APIDOC
## MudTextM3
### Description
Material Design 3 typography component.
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Parameters
- **Typo** (TypoM3) - BodyMedium - Typography style
- **Color** (Color) - Inherit - Text color
- **Align** (Align) - Left - Text alignment
- **ChildContent** (RenderFragment) - null - Text content
- **Class** (string) - null - CSS classes
### TypoM3 Values
```csharp
public enum TypoM3
{
DisplayLarge,
DisplayMedium,
DisplaySmall,
HeadlineLarge,
HeadlineMedium,
HeadlineSmall,
TitleLarge,
TitleMedium,
TitleSmall,
BodyLarge,
BodyMedium,
BodySmall,
LabelLarge,
LabelMedium,
LabelSmall
}
```
### Example Usage
```csharp
Large HeadlineRegular body textSmall label
```
```
--------------------------------
### MudDateWheelPicker for Date Selection
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/README.md
Implement MudDateWheelPicker for an intuitive, wheel-based date selection interface with date constraints.
```razor
```
--------------------------------
### KeyframeBuilder Class
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/types.md
Provides utility methods for generating CSS keyframes for animations.
```csharp
public class KeyframeBuilder
{
public static string Build(int ticks, List values, string property, string defaultValue = "")
public static string Build(int ticks, List> values, string property, string defaultValue = "")
}
```
--------------------------------
### Handle Task Cancellation in Async Operations
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/errors.md
Implement CancellationTokenSource to gracefully handle component disposal during async operations. Catch OperationCanceledException to manage cancellation.
```csharp
private CancellationTokenSource _cancellationTokenSource;
protected override void OnInitialized() {
_cancellationTokenSource = new CancellationTokenSource();
}
async Task LoadData() {
try {
await ScrollManager.ScrollToTopAsync("container");
}
catch (OperationCanceledException) {
// Handle gracefully
}
}
void Dispose() {
_cancellationTokenSource?.Cancel();
_cancellationTokenSource?.Dispose();
}
```
--------------------------------
### Add MudExtensions Namespace
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/README.md
Add the MudExtensions namespace to your _Imports.razor file for easier access to components. This is optional but recommended.
```razor
@using MudExtensions
```
--------------------------------
### Add MudExtensions to Razor Imports
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/configuration.md
Include necessary namespaces in your `_Imports.razor` file to make MudExtensions components and services readily available across your Blazor application.
```razor
@using MudExtensions
@using MudExtensions.Services
@using MudExtensions.Utilities
```
--------------------------------
### MudCodeViewer
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/api-reference/animation-special-components.md
Code display component with syntax highlighting. It supports various programming languages, line numbers, headers, copy functionality, and customizable themes and height.
```APIDOC
## MudCodeViewer
### Description
Code display component with syntax highlighting.
### Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| Code | string | null | Code content to display |
| Language | CodeLanguage | CSharp | Programming language: CSharp, JavaScript, Json, Sql, etc. |
| ShowLineNumbers | bool | true | If true, displays line numbers |
| ShowHeader | bool | true | If true, displays language header |
| Copyable | bool | true | If true, shows copy button |
| MaxHeight | int? | null | Maximum height in pixels |
| Theme | string | "dark" | Color theme: dark or light |
| Class | string | null | CSS classes |
### Example Usage
```csharp
@page "/code-viewer-demo"
@using MudExtensions
@code {
string codeSnippet = @"
public class Example
{
public void HelloWorld()
{
Console.WriteLine(\"Hello, World!\");
}
}
";
}
```
```
--------------------------------
### BeforeInputEventArgs Class Definition
Source: https://github.com/codebeamorg/codebeam.mudblazor.extensions/blob/dev/_autodocs/types.md
Represents event arguments for input events occurring before text insertion. It includes properties to track composition status, input data, and event types like insert, delete, or paste, along with a flag to prevent default behavior.
```csharp
public class BeforeInputEventArgs : EventArgs
{
public bool IsComposing { get; set; }
public string? Data { get; set; }
public bool IsInsert { get; set; }
public bool IsDeleteBackward { get; set; }
public bool IsDeleteForward { get; set; }
public bool IsPaste { get; set; }
public bool PreventDefault { get; set; }
}
```