### Basic Button Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates the creation of a basic button component in Blazorise. No specific setup is required beyond including the Blazorise package. ```csharp ``` -------------------------------- ### Blazorise Addons Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Addons/Code/StaticAddonExampleCode.html Demonstrates how to use the Addons component with Start and Body addon types. Use this to prepend text or elements to an input field. ```html @@ ``` -------------------------------- ### Setup OnScreenKeyboardProvider Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/OnScreenKeyboards/Code/OnScreenKeyboardProviderSetupExampleCode.html This snippet shows the basic setup of the OnScreenKeyboardProvider within the application's root components. Ensure it's nested within ThemeProvider and Router. ```html ``` -------------------------------- ### Blazorise DataGrid Setup Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/DataGrid/Code/DataGridMultipleGroupingExampleCode.html Demonstrates the basic structure for a Blazorise DataGrid component. Ensure you have the necessary Blazorise packages installed and the Blazorise CSS included in your project. ```html ``` ```csharp @code { [Inject] public EmployeeData EmployeeData { get; set; } private List employeeList; protected override async Task OnInitializedAsync() { employeeList = await EmployeeData.GetDataAsync(); await base.OnInitializedAsync(); } } ``` -------------------------------- ### Blazorise Counter Page Example Source: https://github.com/megabit/blazorise/blob/master/README.md Demonstrates a basic counter component using Blazorise components. Requires Blazorise setup. ```razor @page "/counter" Counter Current count: @currentCount @code { private int currentCount; private void IncrementCount() { currentCount++; } } ``` -------------------------------- ### Blazorise Modal Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Provides an example of how to implement a modal dialog using Blazorise. This requires managing the modal's visibility state. Ensure `Blazorise.Modal` is included. ```csharp Modal Title This is the content of the modal. @code { private bool showModal; } ``` -------------------------------- ### Install Toolchain and Build CSS Source: https://github.com/megabit/blazorise/blob/master/Source/Blazorise.Tailwind/README.md Run these commands to install the necessary npm packages and build the custom CSS for Blazorise Tailwind. ```bash npm install npm run build:css ``` -------------------------------- ### Install dotnet-script Tool Source: https://github.com/megabit/blazorise/blob/master/Source/Extensions/Blazorise.Icons.AntDesign/README.md Install the global dotnet-script tool. This is a prerequisite for running C# scripts from the command line. ```bash dotnet tool install -g dotnet-script ``` -------------------------------- ### Blazorise Simple Form Example Source: https://github.com/megabit/blazorise/blob/master/README.md Illustrates a simple form with input and button using Blazorise components. Includes a success alert that appears after saving. Requires Blazorise setup. ```razor @page "/profile" Profile Saved! @code { private string displayName = string.Empty; private bool isSaved; private void Save() { isSaved = true; } } ``` -------------------------------- ### Test-Mcp.ps1: Fetch Single Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs.Mcp/README.md Use the Test-Mcp.ps1 script to fetch a specific example's code from the Blazorise MCP server. Specify the base URL and the example code identifier. ```powershell powershell -File .\Test-Mcp.ps1 -BaseUrl "http://localhost:12791" -ExampleCode "ButtonExample" ``` ```powershell powershell -File .\Test-Mcp.ps1 -BaseUrl "https://mcp.blazorise.com" -ExampleCode "ButtonExample" ``` -------------------------------- ### Install Blazorise Fluent UI Icons Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Icons/Code/IconsNugetInstallExampleCode.html Use this command to install the Blazorise Fluent UI Icons package. ```csharp Install-Package Blazorise.Icons.FluentUI ``` -------------------------------- ### Form Layout Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates using `Row` and `Column` for form layout. ```csharp
Field 1 Field 2
``` -------------------------------- ### Textarea Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates `TextEdit` as a textarea. ```csharp ``` -------------------------------- ### On-Screen Keyboard Layout Examples Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/OnScreenKeyboards/Code/OnScreenKeyboardLayoutExampleCode.html This example shows how to enable the on-screen keyboard for different input types and specify custom layouts. Ensure the 'OnScreenKeyboard' attribute is set to 'true' to activate the keyboard. For specific input types like URLs, use the 'OnScreenKeyboardLayout' attribute to define the appropriate layout. ```html Email layout Numeric layout Explicit layout @code { private string emailValue; private int? numberValue; private string urlValue; } ``` -------------------------------- ### Image Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates the Image component for displaying images with responsive and fluid options. ```csharp Blazorise Logo ``` -------------------------------- ### Progress Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates the `Progress` component for showing loading indicators or progress bars. ```csharp ``` -------------------------------- ### Input Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Shows various `TextEdit` input types. ```csharp ``` -------------------------------- ### Chat Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates a basic chat interface using Blazorise components. This is a conceptual example and would require backend integration for actual chat functionality. ```csharp Chat
``` -------------------------------- ### Spinner Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates the `Spinner` component for indicating loading states. ```csharp ``` -------------------------------- ### Basic Blazorise DataGrid Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/DataGrid/Code/DataGridCaptionExampleCode.html Demonstrates how to set up a basic DataGrid with columns for employee data. Requires Employee model and EmployeeData service. ```html ``` ```csharp @code { [Inject] public EmployeeData EmployeeData { get; set; } private List employeeList; protected override async Task OnInitializedAsync() { employeeList = await EmployeeData.GetDataAsync(); await base.OnInitializedAsync(); } } ``` -------------------------------- ### Run Blazorise Documentation Server Source: https://github.com/megabit/blazorise/blob/master/CONTRIBUTING.md Navigate to the documentation server folder and run this command to start the development server. Your browser will open automatically. ```powershell dotnet watch run ``` -------------------------------- ### Blazorise Tooltip with Right Placement Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Tooltips/Code/TooltipPositionsExampleCode.html This example shows how to position a tooltip to the right of the button. No special setup is required beyond the component itself. ```html ``` -------------------------------- ### Column Offsets Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Shows how to use column offsets to create spacing between columns. ```csharp Column 1 Column 2 (Offset) ``` -------------------------------- ### Layout Grid Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Shows how to use Blazorise's layout system for creating responsive grids. Utilizes `Row` and `Column` components. ```csharp Column 1 Column 2 ``` -------------------------------- ### Nested Dropdown Example in Blazorise Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Dropdowns/Code/NestedDropdownExampleCode.html Demonstrates how to create a multi-level dropdown menu using Blazorise components. Ensure all necessary Blazorise packages are installed and configured. ```csharp Level 1 Item 1.1 Level 2 Item 2.1 Item 2.2 Level 3 Item 3.1 Item 3.2 Level 4 Item 4.1 Item 4.2 ``` -------------------------------- ### Layout Grid Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates the Blazorise grid system using `Container`, `Row`, and `Column` for responsive layouts. ```csharp

Column 1 (6/12)

Column 2 (6/12)

Column 1 (4/12)

Column 2 (4/12)

Column 3 (4/12)

Full width column

``` -------------------------------- ### Sizing Utilities Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates using sizing utilities (`w-25`, `h-50`, `mw-100`) to control the width and height of elements. ```csharp
25% width
50% height
``` -------------------------------- ### Image Cropper and Preview Setup Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Cropper/Code/CropperViewerExampleCode.html Demonstrates how to integrate the Cropper component for image selection and CropperViewer for displaying previews. Ensure the CropperState is initialized. ```razor Image Cropper Preview @code { private CropperState cropperState = new(); } ``` -------------------------------- ### Responsive Columns Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates how to create columns that adapt to different screen sizes using Blazorise's responsive column size options (e.g., `IsSm`, `IsMd`, `IsLg`). ```csharp Responsive Column Responsive Column ``` -------------------------------- ### Vertical Sidebar Navigation with Blazorise Bar Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Bar/Code/VerticalBarSideBarExampleCode.html This code snippet demonstrates a complete vertical sidebar navigation setup using Blazorise. It configures the Bar component for inline vertical display, with collapse behavior for small screens and specific breakpoints for navigation toggling. It includes brand, menu start, and menu end items with nested dropdowns. ```html Ops Console Overview Analytics Traffic Conversion Retention Customers All customers Segments Imports Billing Settings
Workspace overview
The vertical Bar works well as the primary navigation inside a layout sider.
``` -------------------------------- ### Select Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates the `Select` component for creating dropdown lists. Use `SelectItem` for each option. ```csharp ``` -------------------------------- ### Basic Blazorise DataGrid Setup Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/DataGrid/Code/DataGridColumnChooserDisplayableExampleCode.html Demonstrates the basic structure of a Blazorise DataGrid with columns. Use this for displaying tabular data with options for column customization. ```html ``` ```csharp @code { public IEnumerable Data { get; set; } = new List() { new() { Name = "John", Salary = 1000m }, new() { Name = "Sarah", Salary = 2000m }, }; public class Employee { public string Name { get; set; } public decimal Salary { get; set; } } } ``` -------------------------------- ### Install Blazorise Material Icons Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Icons/Code/IconsNugetInstallExampleCode.html Use this command to install the Blazorise Material Icons package. ```csharp Install-Package Blazorise.Icons.Material ``` -------------------------------- ### Layout Grid Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates the grid system using `Container`, `Row`, and `Column` for responsive layouts. ```csharp Content 1 Content 2 ``` -------------------------------- ### Install Blazorise Lucide Icons Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Icons/Code/IconsNugetInstallExampleCode.html Use this command to install the Blazorise Lucide Icons package. ```csharp Install-Package Blazorise.Icons.Lucide ``` -------------------------------- ### Install Blazorise Bootstrap Icons Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Icons/Code/IconsNugetInstallExampleCode.html Use this command to install the Blazorise Bootstrap Icons package. ```csharp Install-Package Blazorise.Icons.Bootstrap ``` -------------------------------- ### Column Ordering Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates how to reorder columns using Blazorise's ordering utilities (e.g., `OrderMdFirst`, `OrderMdLast`). ```csharp First Column (Order First on Medium screens) Second Column Third Column (Order Last on Medium screens) ``` -------------------------------- ### Install Blazorise FluentValidation Package Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/FluentValidation/Code/FluentValidationNugetInstallExampleCode.html Install the Blazorise.FluentValidation NuGet package to enable integration with FluentValidation. ```csharp Install-Package Blazorise.FluentValidation ``` -------------------------------- ### Install FluentValidation Dependency Injection Extensions Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/FluentValidation/Code/FluentValidationNugetInstallExampleCode.html Install the FluentValidation.DependencyInjectionExtensions NuGet package for dependency injection support. ```csharp Install-Package FluentValidation.DependencyInjectionExtensions ``` -------------------------------- ### Basic Pagination Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates how to implement pagination controls using Blazorise. Pagination is used to navigate through large sets of data divided into pages. ```csharp ``` -------------------------------- ### File Upload Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates how to implement file uploads using the `FileUpload` component. Requires handling the uploaded file data. ```csharp @code { private FileUpload _fileUpload; private async Task UploadFile() { if (_fileUpload.Files != null && _fileUpload.Files.Any()) { // Handle file upload logic here } } } ``` -------------------------------- ### Install Yarn Globally Source: https://github.com/megabit/blazorise/blob/master/Source/Blazorise/README.md Install Yarn as a global package using npm. This is a prerequisite for building some external libraries. ```bash npm install -g yarn ``` -------------------------------- ### Install Blazorise Font Awesome Icons Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Icons/Code/IconsNugetInstallExampleCode.html Use this command to install the Blazorise Font Awesome Icons package. ```csharp Install-Package Blazorise.Icons.FontAwesome ``` -------------------------------- ### Blazorise DataGrid Basic Implementation Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/DataGrid/Code/DataGridColumnChooserExampleCode.html Demonstrates the basic setup of a Blazorise DataGrid with in-memory data. Includes configuration for responsiveness, column chooser, and pagination. ```razor @code { [Inject] EmployeeData EmployeeData { get; set; } private IEnumerable inMemoryData; protected override async Task OnInitializedAsync() { inMemoryData = ( await EmployeeData.GetDataAsync().ConfigureAwait( false ) ).Take( 25 ); await base.OnInitializedAsync(); } protected void ColumnDisplayChanged( ColumnDisplayChangedEventArgs args ) { Console.WriteLine( $"Column: {args.Column.Field} | Display: {args.Display}" ); } } ``` -------------------------------- ### Responsive Columns Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates responsive column behavior using different sizes for different screen breakpoints. ```csharp Responsive Column Responsive Column Responsive Column ``` -------------------------------- ### Install Blazorise Ant Design Icons Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Icons/Code/IconsNugetInstallExampleCode.html Use this command to install the Blazorise Ant Design Icons package. ```csharp Install-Package Blazorise.Icons.AntDesign ``` -------------------------------- ### Table Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Shows how to create basic HTML tables using Blazorise styling. Supports various table classes. ```csharp
Header 1Header 2
Data 1Data 2
Data 3Data 4
``` -------------------------------- ### Basic FileUpload Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates the basic Blazorise FileUpload component for allowing users to upload files. Requires server-side handling for actual upload. ```csharp ``` -------------------------------- ### Blazorise Overflow Auto Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Helpers/Utilities/Overflow/Code/OverflowExampleCode.html Use Overflow.Auto to enable scrolling when content exceeds container dimensions. This example shows vertical scrolling. ```razor
This is an example of using Overflow.Auto on an element with set width and height dimensions. By design, this content will vertically scroll.
This is an example of using Overflow.Hidden on an element with set width and height dimensions.
This is an example of using Overflow.Visible on an element with set width and height dimensions.
This is an example of using Overflow.Scroll on an element with set width and height dimensions.
``` -------------------------------- ### Basic Layout Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Layouts/Code/BasicLayoutExampleCode.html A fundamental example of the Blazorise Layout component, showcasing its header, content, and footer sections with basic styling and content. ```html Sales Portal Quarterly pipeline Track open opportunities, team activity, and forecast changes from the main content region. Updated 12 minutes ago ``` -------------------------------- ### Align Items Start with Blazorise Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Helpers/Utilities/Flex/Code/FlexAlignItemsExampleCode.html Sets flex items to align at the start of the cross-axis. Requires Blazorise components and basic CSS styling. ```razor
Flex item 1
Flex item 2
Flex item 3
``` -------------------------------- ### Install Playwright Browser Dependencies Source: https://github.com/megabit/blazorise/blob/master/CONTRIBUTING.md Execute this PowerShell command from the E2E tests directory to install necessary Playwright browser dependencies for end-to-end testing. ```powershell powershell .\bin\Debug\net10.0\playwright.ps1 install --with-deps ``` -------------------------------- ### Indeterminate Checkbox Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Checks/Code/CheckIndeterminateExampleCode.html This example shows how to create a 'select all' checkbox that can be in an indeterminate state. It uses a HashSet to manage selected items and updates the UI accordingly. ```html Select all
@foreach ( string item in Items ) { @item }
``` ```csharp @using System.Collections.Generic @code { private static readonly string[] Items = [ "Documentation", "Examples", "Tests" ]; private readonly HashSet selectedItems = new() { "Documentation" }; private bool AreAllSelected => selectedItems.Count == Items.Length; private bool AreSomeSelected => selectedItems.Count > 0 && !AreAllSelected; private void OnSelectAllChanged( bool value ) { selectedItems.Clear(); if ( value ) { foreach ( string item in Items ) { selectedItems.Add( item ); } } } private void OnItemChanged( string item, bool value ) { if ( value ) { selectedItems.Add( item ); } else { selectedItems.Remove( item ); } } } ``` -------------------------------- ### Progress Component Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates the `Progress` component for showing loading or progress status. Use `Value` to set the progress percentage. ```csharp ``` -------------------------------- ### Dropdown Menu Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates how to create a dropdown menu with multiple options. Use `Dropdown` and `DropdownItem` components for this. ```csharp Dropdown Action 1 Action 2 Separated action ``` -------------------------------- ### Basic Chart Example (Line Chart) Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Illustrates how to create a basic line chart using Blazorise Charts. Charts are used for data visualization. ```csharp @code { private LineChartOptions lineChartOptions; private LineChartData lineChartData; } ``` -------------------------------- ### Test-Mcp.ps1: General Script Commands Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs.Mcp/README.md Examples of using the Test-Mcp.ps1 script for various documentation retrieval tasks, including fetching examples, listing pages, and setting timeouts. ```powershell powershell -File .\Test-Mcp.ps1 -BaseUrl "http://localhost:12791" -ExampleCode "ButtonExample" powershell -File .\Test-Mcp.ps1 -BaseUrl "https://mcp.blazorise.com" -ExampleCode "ButtonExample" powershell -File .\Test-Mcp.ps1 -BaseUrl "https://mcp.blazorise.com" -ListDocsPages -RoutePrefix "/docs/components/button" powershell -File .\Test-Mcp.ps1 -BaseUrl "http://localhost:12791" -ListDocsPages -RoutePrefix "/docs" powershell -File .\Test-Mcp.ps1 -BaseUrl "http://localhost:12791" -TimeoutSeconds 60 -ProtocolVersion "2024-11-05" ``` -------------------------------- ### Basic Validation Feedback Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Validations/Code/ValidationFeedbackExampleCode.html This example shows how to use the Feedback component with different validation status types like ValidationNone, ValidationWarning, ValidationSuccess, and ValidationError within a TextInput. ```html Please enter a display name. Short display names are allowed, but longer names are easier to recognize. Display name looks good. Display name is required. ``` -------------------------------- ### Step Navigation Control Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Steps/Code/StepNavigationAllowedExampleCode.html This example shows how to use the NavigationAllowed parameter to conditionally prevent users from moving to the next step. It's useful for implementing validation before proceeding. ```html Step 1 Step 2 Step 3 Step 4 Step 1 Email address This field is required in order to proceed to the next step. Step 3 Step 4
``` ```csharp @code { private Steps stepsRef; private string email; private string selectedStep = "2"; private Task NavigationAllowed( StepNavigationContext context ) { if ( context.CurrentStepIndex == 2 && context.NextStepIndex > 2 && !ValidationRule.IsEmail( email ) ) { return Task.FromResult( false ); } return Task.FromResult( true ); } } ``` -------------------------------- ### Basic Icon Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates how to display an icon using the Blazorise Icon component. Blazorise supports various icon libraries like Font Awesome. ```csharp ``` -------------------------------- ### Blazorise Scheduler Component Setup Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Scheduler/Code/SchedulerDraggableExampleCode.html Basic setup of the Blazorise Scheduler component with data binding for date, data source, and selected view. Enables editing and dragging of appointments. ```razor ``` -------------------------------- ### Blazorise DataGrid Basic Setup Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/DataGrid/Code/DataGridColumnChooserPositionExampleCode.html Configure a Blazorise DataGrid with data binding, responsiveness, column chooser, and pager options. Ensure EmployeeData service is injected and data is loaded in OnInitializedAsync. ```csharp @code { [Inject] EmployeeData EmployeeData { get; set; } private IEnumerable inMemoryData; protected override async Task OnInitializedAsync() { inMemoryData = ( await EmployeeData.GetDataAsync().ConfigureAwait( false ) ).Take( 25 ); await base.OnInitializedAsync(); } } ``` -------------------------------- ### SvgColumnChart Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/SvgChart/Code/SvgColumnChartExampleCode.html This example shows a basic SvgColumnChart displaying monthly revenue and expenses. It includes configuration for title, legend, tooltip, and axes, along with defining two column series. ```html @code { private readonly SvgChartOptions options = new() { Height = 360, Legend = new() { Position = SvgChartLegendPosition.Bottom }, }; private readonly List revenue = [ new() { Month = "Jan", Revenue = 68, Expenses = 42 }, new() { Month = "Feb", Revenue = 74, Expenses = 46 }, new() { Month = "Mar", Revenue = 91, Expenses = 52 }, new() { Month = "Apr", Revenue = 86, Expenses = 49 }, new() { Month = "May", Revenue = 103, Expenses = 61 }, ]; private sealed class MonthlyRevenue { public string Month { get; set; } public double Revenue { get; set; } public double Expenses { get; set; } } } ``` -------------------------------- ### Basic Addons Implementation Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Components/Addons/Code/MultipleAddonsExampleCode.html Demonstrates how to use the Addons component with Start, Body, and End addon types. The Body addon typically contains an input element. ```html Start End ``` -------------------------------- ### Blazorise Line Chart Component Setup Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Chart/Code/ChartExampleCode.html This snippet shows the basic setup of a Blazorise LineChart component and its associated button for redrawing the chart. It includes the component declaration and a button that triggers an asynchronous redraw operation. ```razor ``` -------------------------------- ### Chart Example (Bar Chart) Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PdfViewer/Code/PdfViewerBase64ExampleCode.html Demonstrates how to create a bar chart using Blazorise Charts. Requires the Blazorise.Charts package. Ensure you have data in the correct format. ```csharp @code { private BarChartData _barChartData; private BarChartOptions _barChartOptions; protected override void OnInitialized() { _barChartData = new BarChartData { Labels = new List { "January", "February", "March" }, Datasets = new List { new Dataset { Label = "Sales", Data = new List { 10, 20, 15 }, BackgroundColor = "rgba(75, 192, 192, 0.2)", BorderColor = "rgba(75, 192, 192, 1)" } } }; _barChartOptions = new BarChartOptions { Responsive = true }; } } ``` -------------------------------- ### Blazorise Scheduler Component Setup Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/Scheduler/Code/SchedulerEditableExampleCode.html This snippet shows the basic setup of the Blazorise Scheduler component, including data binding for dates, events, and selected views. It also demonstrates how to enable editing and configure toolbar and views. ```razor ``` -------------------------------- ### PivotGrid with Styling Example Source: https://github.com/megabit/blazorise/blob/master/Documentation/Blazorise.Docs/Pages/Docs/Extensions/PivotGrid/Code/PivotGridStylingExampleCode.html This example shows a PivotGrid configured with data, column, row, and aggregate definitions. It also includes callbacks for applying custom styles to cells, row headers, and column headers based on their values and context. ```html ``` ```csharp @code { private readonly List Sales = [ new() { City = "Berlin", Category = "Hardware", Product = "Laptops", Amount = 51200m, Units = 18 }, new() { City = "Berlin", Category = "Software", Product = "Licenses", Amount = 94200m, Units = 205 }, new() { City = "London", Category = "Hardware", Product = "Laptops", Amount = 127500m, Units = 34 }, new() { City = "London", Category = "Services", Product = "Consulting", Amount = 66300m, Units = 36 }, new() { City = "Madrid", Category = "Services", Product = "Training", Amount = 28700m, Units = 64 }, new() { City = "Paris", Category = "Software", Product = "Subscriptions", Amount = 124500m, Units = 355 }, ]; private void OnCellStyling( PivotGridCellContext context, PivotGridCellStyling styling ) { if ( context.Aggregate.Field != nameof( PivotSale.Amount ) || context.Value is not decimal amount ) return; if ( amount >= 100000m ) { styling.Background = Background.Success; styling.TextColor = TextColor.White; styling.TextWeight = TextWeight.Bold; } else if ( amount <= 30000m ) { styling.Background = Background.Danger; styling.TextColor = TextColor.White; styling.TextWeight = TextWeight.Bold; } } private void OnRowHeaderStyling( PivotGridRowHeaderContext context, PivotGridCellStyling styling ) { if ( context.IsGrandTotal ) { styling.Background = Background.Info; styling.TextColor = TextColor.White; styling.TextWeight = TextWeight.Bold; } else if ( context.IsTotal ) { styling.Background = Background.Secondary; styling.TextColor = TextColor.White; styling.TextWeight = TextWeight.Bold; } } private void OnColumnHeaderStyling( PivotGridColumnHeaderContext context, PivotGridCellStyling styling ) { if ( context.IsGrandTotal || context.IsTotal ) { styling.Background = Background.Info; styling.TextColor = TextColor.White; styling.TextWeight = TextWeight.Bold; } } public class PivotSale { public string City { get; set; } public string Category { get; set; } public string Product { get; set; } public decimal Amount { get; set; } public int Units { get; set; } } } ```