### Install BlazyUI Package Source: https://github.com/ogix/blazyui/blob/main/README.md Installs the BlazyUI NuGet package into your .NET project. This is the first step to start using the BlazyUI components. ```bash dotnet add package BlazyUI ``` -------------------------------- ### BlazyUI NavBar HTML Output Example Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-navbar-design.md Shows the resulting HTML structure generated by the BlazyUI NavBar component when specific parameters are applied. This example includes classes for color, sticky positioning, and shadow. ```html ``` -------------------------------- ### Run BlazyUI Demo Application Source: https://github.com/ogix/blazyui/blob/main/README.md Details the steps to run the BlazyUI demo application after cloning and building the project. It includes navigating to the demo directory, installing Node.js dependencies, and executing the run command. ```bash # Run the demo app cd src/BlazyUI.Demo npm install dotnet run ``` -------------------------------- ### BlazyLoading Component Examples Source: https://context7.com/ogix/blazyui/llms.txt Demonstrates the usage of the BlazyLoading component with different animation types, sizes, and colors. It also shows how to use it as a loading overlay. This component requires no external dependencies beyond the BlazyUI library. ```razor @* Loading types *@ @* Sizes *@ @* Colors *@ @* Loading overlay pattern *@ @if (isLoading) {
} @code { private bool isLoading = false; } ``` -------------------------------- ### BlazySelect Examples Source: https://context7.com/ogix/blazyui/llms.txt Illustrates the usage of the BlazySelect component, including basic dropdowns, styling with colors and sizes, ghost mode, and integration with Blazor's EditForm for validation. ```razor @* Basic select *@ @* With color and size *@ @* Ghost style *@ @* In EditForm with validation *@ Submit @code { private string selectedCountry = ""; private string selectedSize = ""; private string selectedOption = ""; private OrderModel order = new(); private async Task SubmitOrder() { } public class OrderModel { [Required] public string Category { get; set; } = ""; } } ``` -------------------------------- ### BlazyUI Loading Component Examples (Razor) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-loading-design.md Demonstrates various ways to use the BlazyUI Loading component in Razor syntax. Includes examples for default usage, specifying loading types, sizes, colors, and accessibility attributes. ```razor ``` -------------------------------- ### BlazyTextInput Examples Source: https://context7.com/ogix/blazyui/llms.txt Demonstrates various configurations of the BlazyTextInput component, including different input types, sizes, colors, and ghost styling. It also shows integration with Blazor's EditForm for validation using DataAnnotations. ```razor @* Basic text inputs *@ @* Size variants *@ @* Color variants *@ @* Ghost style (no background) *@ @* With EditForm validation *@ Register @code { private string username = ""; private string email = ""; private string password = ""; private string text = ""; private RegistrationModel model = new(); private async Task HandleSubmit() { // Process form submission } public class RegistrationModel { [Required, EmailAddress] public string Email { get; set; } = ""; [Required, MinLength(8)] public string Password { get; set; } = ""; } } ``` -------------------------------- ### Production Build Command Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-tailwind-daisyui-setup-design.md Commands to build and publish the Blazor application in Release configuration. This prepares the project for deployment. ```bash dotnet build -c Release dotnet publish -c Release ``` -------------------------------- ### Blazor Button Component Usage Examples Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-button-component-design.md Illustrates various ways to use the BlazyUI button component in Blazor applications. Examples cover basic usage, styling with different colors and sizes, incorporating loading states, creating icon buttons, and applying custom CSS classes. ```razor @* Basic *@ @* Styled *@ @* Outline with loading *@ @* Icon button *@ @* With custom classes *@ ``` -------------------------------- ### Run Demo App with dotnet run in Bash Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-phase1-foundation.md Starts the BlazyUI demo application using the .NET CLI. This command compiles and runs the demo project, allowing for visual verification of components in a local environment. The output typically includes the URL where the application can be accessed. ```bash cd src/BlazyUI.Demo && dotnet run ``` -------------------------------- ### Development Workflow for CSS and Blazor Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-tailwind-daisyui-setup-design.md Commands to initiate the development workflow. One terminal runs a script to watch for CSS changes and rebuild, while another runs the Blazor application with hot-reloading enabled. ```bash # Terminal 1: CSS watcher cd src/BlazyUI.Demo npm run watch:css # Terminal 2: Blazor app dotnet watch --project src/BlazyUI.Demo ``` -------------------------------- ### Blazor Alert Component Usage Examples Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-alert-component-design.md Demonstrates various ways to use the Blazor Alert component, including basic alerts, alerts with different colors, icons, styles, and layouts. It also shows how to apply custom CSS classes for further customization. ```razor @* Basic *@ This is a simple alert message. @* With color *@ Operation completed! @* With icon *@ Warning: Check your input! @* Soft style *@ Important information here. @* Outline error *@ Something went wrong! @* Responsive layout via Class parameter *@ Vertical on mobile, horizontal on desktop. @* With custom classes *@ Success with shadow! ``` -------------------------------- ### BlazyProgress Component Examples Source: https://context7.com/ogix/blazyui/llms.txt Showcases the BlazyProgress component for displaying task completion status in both determinate and indeterminate modes. Examples include various color options, dynamic updates, and a simulation of an upload process. This component has no external dependencies. ```razor @* Determinate progress *@ @* Color variants *@ @* Indeterminate (animated) - no value *@ @* Dynamic progress example *@

@uploadProgress% complete

@(isUploading ? "Uploading..." : "Start Upload") @code { private int uploadProgress = 0; private bool isUploading = false; private async Task SimulateUpload() { isUploading = true; uploadProgress = 0; while (uploadProgress < 100) { await Task.Delay(100); uploadProgress += 5; StateHasChanged(); } isUploading = false; } } ``` -------------------------------- ### BlazyBadge Component Examples Source: https://context7.com/ogix/blazyui/llms.txt Illustrates the BlazyBadge component's versatility in displaying labels, counts, and tags. It covers various color, size, and style variants, including its integration within a button for notification counts. No external dependencies are required. ```razor @* Color variants *@ Default Primary Secondary Accent Info Success Warning Error @* Size variants *@ XS Small Medium Large @* Style variants *@ Outline Soft Dash Ghost @* In button with notification count *@ Inbox 99+ ``` -------------------------------- ### BlazyUI Button Example (Razor) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-code-example-component-design.md This Razor component demonstrates the usage of the Button component within the BlazyUI framework. It showcases various button color options and provides the corresponding Razor code for each button. ```razor @page "/buttons" Buttons

Button Component

Basic

@code { private string basicCode = "\n\n\n\n\n\n\n\n"; } ``` -------------------------------- ### BlazyCard: Creating content containers in Razor Source: https://context7.com/ogix/blazyui/llms.txt Illustrates the usage of the BlazyCard component for structuring content. Examples cover basic cards, cards with images, horizontal layouts, different styles, and cards with image backgrounds. ```razor @* Basic card *@ Card Title

This is the card content with some descriptive text.

Action
@* Card with image *@ Card image Photo Card

A beautiful landscape photograph.

View
@* Horizontal card with side image *@ Side image Horizontal Layout

Card with image on the side.

@* Style variants *@ Bordered Card

Small card with border style.

@* Full image background card *@ Background Overlay Card

Content overlaid on image background.

``` -------------------------------- ### Configure BlazyUI Modal Options Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-19-modal-design.md Demonstrates how to configure advanced options for BlazyUI modals, such as setting backdrop click behavior and applying custom CSS classes. This example shows configuring a 'LargeFormModal' with specific parameters and options. ```csharp var result = await ModalService.Show( parameters: new Dictionary { ["FormId"] = 456 }, configure: options => { options.CloseOnBackdropClick = true; options.CssClass = "max-w-3xl"; // wider modal }); ``` -------------------------------- ### BlazyTooltip Examples - Blazor Source: https://context7.com/ogix/blazyui/llms.txt Demonstrates the usage of BlazyTooltip for displaying hover information. Supports customizable text, position (Top, Bottom, Left, Right), color variants (Primary, Error, Info), and rich HTML content. The tooltip can also be set to always be open. ```razor @* Basic tooltip *@ Hover me @* Position variants *@ Top Bottom Left Right @* Color variants *@ Primary ! @* Always open tooltip *@ Pinned tooltip @* Rich content tooltip *@
Rich Content

Supports HTML content

Rich Tooltip
``` -------------------------------- ### BlazyUI Layout Setup (Razor) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-19-modal-design.md This Razor code shows how to integrate the BlazyUI `ModalProvider` into the main application layout. Placing `` ensures that modal dialogs can be rendered throughout the application. This is typically added to the `MainLayout.razor` file. ```razor @* MainLayout.razor *@ @inherits LayoutComponentBase
@* existing layout content *@
``` -------------------------------- ### Triggering Simple Dialogs (C#) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-19-modal-design.md These C# examples demonstrate how to use the `IModalService` to display information, warning, and error dialogs. The `Info`, `Warning`, and `Error` methods can be called with a title and message. The `Error` method also supports custom button text via the `okText` parameter. These calls are asynchronous and return a Task. ```csharp @inject IModalService ModalService // Information await ModalService.Info("Success", "Record saved successfully"); // Warning await ModalService.Warning("Caution", "This operation may take a while"); // Error await ModalService.Error("Failed", "Could not connect to server"); // Custom button text await ModalService.Error("Delete Failed", "File is in use", okText: "Got it"); ``` -------------------------------- ### BlazyUI NavBar Component Usage (Razor) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-navbar-design.md Demonstrates how to use the BlazyUI NavBar component in a Blazor application. It shows the structure for placing content in the start, center, and end sections, along with parameter usage for color, sticky, and shadow effects. ```razor BlazyUI Home About ``` -------------------------------- ### BlazyButton Component Examples Source: https://context7.com/ogix/blazyui/llms.txt This Razor code demonstrates various ways to use the BlazyButton component, including different color variants, sizes, styles, loading and disabled states, shape variants, and rendering as a link. It also shows basic event handling for the OnClick event. ```razor @* Basic button variants *@ Primary Outline Large Soft Error @* Loading and disabled states *@ Saving... Disabled @* Shape variants *@ + X Full Width Button @* Link button (renders as anchor) *@ External Link @* Event handling *@ Click Me @code { private async Task HandleClick(MouseEventArgs args) { // Handle button click Console.WriteLine($"Button clicked at: {args.ClientX}, {args.ClientY}"); } } ``` -------------------------------- ### Configure Tailwind CSS and DaisyUI Source: https://github.com/ogix/blazyui/blob/main/README.md Installs Tailwind CSS and DaisyUI npm packages and configures the main CSS file to import them. This setup is crucial for BlazyUI's styling and theming capabilities. ```bash npm install -D tailwindcss@^4 daisyui@^5 ``` ```css @import "tailwindcss"; @plugin "daisyui"; /* Optional: Configure themes */ @plugin "daisyui" { themes: light --default, dark --prefersdark; } /* Scan your project and BlazyUI components */ @source "../Components/**/*.razor"; @source "../bin/blazyui/Components"; ``` -------------------------------- ### Integrate Tailwind CSS Build with MSBuild Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-tailwind-daisyui-setup-design.md MSBuild targets to manage the npm installation and execute the Tailwind CSS build command during the release configuration or when the output CSS file is missing. Ensures CSS is built before the main project. ```xml ``` -------------------------------- ### Build BlazyUI Solution Source: https://github.com/ogix/blazyui/blob/main/README.md Contains the .NET CLI command to build the entire BlazyUI solution. This command compiles all projects within the solution, including the component library and the demo application. ```bash # Build the solution dotnet build ``` -------------------------------- ### CodeExample Component Usage (Razor) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-code-example-component-design.md Demonstrates how to use the CodeExample component in a Razor page. It takes the source code as a string and wraps the rendered component within its content. The `Code` parameter holds the Razor/HTML markup, and `Title` provides an optional heading. ```razor @code { private string primaryButtonCode = ""; } ``` -------------------------------- ### Highlight.js CDN Integration (HTML) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-code-example-component-design.md Shows how to include the Highlight.js library and its necessary language modules via CDN in an HTML file. This is a simple way to enable syntax highlighting without a build process. Ensure the CSS theme and language scripts are correctly linked. ```html ``` -------------------------------- ### Build and Run BlazyUI Project Commands (Bash) Source: https://github.com/ogix/blazyui/blob/main/CLAUDE.md Provides essential bash commands for building the BlazyUI solution, running the demo application, and managing CSS development with hot reload. It requires two terminals for CSS watch and Blazor app execution. ```bash # Build the entire solution dotnet build # Run the demo app (from src/BlazyUI.Demo) cd src/BlazyUI.Demo dotnet run # CSS development (requires two terminals) # Terminal 1: Watch CSS changes cd src/BlazyUI.Demo && npm run watch:css # Terminal 2: Run Blazor app with hot reload dotnet watch --project src/BlazyUI.Demo ``` -------------------------------- ### BlazyUI CodeExample Component (Razor) Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-code-example-component-design.md The CodeExample component in BlazyUI allows for displaying code snippets alongside their rendered output. It supports toggling code visibility, copying code to the clipboard, and integrates with JavaScript for syntax highlighting. It requires the IJSRuntime service for JavaScript interop. ```razor @inject IJSRuntime JSRuntime
@if (!string.IsNullOrEmpty(Title)) {
@Title
}
@ChildContent
@if (showCode) { }
@if (showCode) {
@Code
}
@code { [Parameter] public RenderFragment ChildContent { get; set; } = default!; [Parameter] public string Code { get; set; } = ""; [Parameter] public string Language { get; set; } = "html"; [Parameter] public string? Title { get; set; } [Parameter] public bool DefaultExpanded { get; set; } = false; private bool showCode; private bool copied; private string codeId = $"code-{Guid.NewGuid():N}"; protected override void OnInitialized() { showCode = DefaultExpanded; } private async Task ToggleCode() { showCode = !showCode; if (showCode) { await Task.Delay(1); // Wait for DOM update await JSRuntime.InvokeVoidAsync("codeHighlight.highlight", codeId); } } private async Task CopyCode() { var success = await JSRuntime.InvokeAsync("codeHighlight.copyToClipboard", Code); if (success) { copied = true; StateHasChanged(); await Task.Delay(2000); copied = false; StateHasChanged(); } } } ``` -------------------------------- ### Configure npm Dependencies and Scripts Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-tailwind-daisyui-setup-design.md Defines development dependencies for Tailwind CSS and DaisyUI, along with scripts for building and watching CSS files. This configuration is essential for the CSS build process. ```json { "devDependencies": { "tailwindcss": "^4", "daisyui": "^5" }, "scripts": { "build:css": "npx @tailwindcss/cli -i ./wwwroot/css/app.css -o ./wwwroot/css/app.min.css --minify", "watch:css": "npx @tailwindcss/cli -i ./wwwroot/css/app.css -o ./wwwroot/css/app.min.css --watch" } } ``` -------------------------------- ### TextInput Component Styled Usage - Razor Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-textinput-design.md Illustrates how to apply custom styling to the BlazyUI TextInput component using the `Color` and `Size` parameters. Examples show a large primary colored input and a small ghost input. ```razor @* Styled *@ ``` -------------------------------- ### Clone BlazyUI Repository Source: https://github.com/ogix/blazyui/blob/main/README.md Provides the bash command to clone the BlazyUI project from its GitHub repository. This is the first step in setting up the project locally for development or contribution. ```bash # Clone the repository git clone https://github.com/your-username/BlazyUI.git cd BlazyUI ``` -------------------------------- ### Clean and Rebuild Solution with dotnet in Bash Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-phase1-foundation.md Performs a clean operation followed by a build of the entire solution using .NET CLI commands. This ensures that all intermediate build files are removed and the project is rebuilt from scratch, verifying its overall integrity. ```bash dotnet clean && dotnet build ``` -------------------------------- ### Import Tailwind CSS and DaisyUI Plugins Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-tailwind-daisyui-setup-design.md This CSS file imports Tailwind CSS and the DaisyUI plugin, and specifies source files for component styles. It's the main input for the CSS build process. ```css @import "tailwindcss"; @plugin "daisyui"; @source "../../BlazyUI/**/*.razor"; @source "../Components/**/*.razor"; ``` -------------------------------- ### Run BlazyUI with Hot Reload Source: https://github.com/ogix/blazyui/blob/main/README.md Instructs on how to run the BlazyUI demo application with the .NET watch tool, enabling Blazor hot reload. This command should be executed in a separate terminal from the CSS watch process for optimal development workflow. ```bash # Terminal 2: Run with hot reload dotnet watch --project src/BlazyUI.Demo ``` -------------------------------- ### Verify Folder Structure with find and grep in Bash Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-phase1-foundation.md Lists all C# and Razor files within the `src/BlazyUI` directory, excluding files in `obj` folders, and sorts the output. This command is used to verify that the project's file structure is as expected after the recent changes. ```bash find src/BlazyUI -type f \( -name "*.cs" -o -name "*.razor" \) | grep -v obj | sort ``` -------------------------------- ### BlazyCheckbox and BlazyToggle Usage Source: https://context7.com/ogix/blazyui/llms.txt Demonstrates the usage of BlazyCheckbox and BlazyToggle components for creating boolean input fields. Supports various color and size variants, and integrates with BlazyUI's EditForm for validation. Includes examples with labels and within a form context. ```razor @* Checkbox variants *@ @* Toggle variants *@ @* With labels in form *@ Save Settings @code { private bool isChecked = false; private bool isPrimary = true; private bool isSuccess = false; private bool isEnabled = true; private bool isPrimaryToggle = false; private bool isAccentToggle = true; private SettingsModel settings = new(); private async Task SaveSettings() { } public class SettingsModel { public bool EmailNotifications { get; set; } = true; public bool PushNotifications { get; set; } = false; public bool DarkMode { get; set; } = false; } } ``` -------------------------------- ### Creating a Navigation Bar with BlazyNavBar Source: https://context7.com/ogix/blazyui/llms.txt Illustrates the structure of the BlazyNavBar component, which allows for defining content in start, center, and end sections. It supports features like sticky positioning and color variants, and can contain other BlazyUI components like menus and buttons. ```razor MyApp Home Products Services Consulting Support Sign In ``` -------------------------------- ### Build Project with dotnet build in Bash Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-phase1-foundation.md Executes the .NET build command to compile the project. This command verifies the project's integrity and checks for any compilation errors. It is used after code changes to ensure the project builds successfully. ```bash dotnet build ``` -------------------------------- ### BlazyAccordion Examples - Blazor Source: https://context7.com/ogix/blazyui/llms.txt Illustrates the BlazyAccordion component for creating collapsible content sections. Supports basic accordion functionality and an exclusive mode using the GroupName parameter, ensuring only one item is open at a time. Custom indicators like arrows can also be applied. ```razor @* Basic accordion *@ Section 1

Content for section 1. This can contain any HTML or Blazor components.

Section 2

Content for section 2.

Section 3

Content for section 3.

@* Exclusive accordion (only one open at a time) *@ What is BlazyUI?

BlazyUI is a Blazor component library wrapping DaisyUI v5 with Tailwind CSS v4.

How do I install it?

Install via NuGet: dotnet add package BlazyUI

Is it free to use?

Yes, BlazyUI is open source and free to use under the MIT license.

``` -------------------------------- ### JavaScript Interop for Code Highlighting and Copying Source: https://github.com/ogix/blazyui/blob/main/docs/plans/2026-01-17-code-example-component-design.md Provides JavaScript functions for integrating with the Highlight.js library and the browser's Clipboard API. The `highlight` function applies syntax highlighting to a specified HTML element, while `copyToClipboard` handles copying text to the user's clipboard. ```javascript // wwwroot/js/code-highlight.js window.codeHighlight = { highlight: function(elementId) { const element = document.getElementById(elementId); if (element) { hljs.highlightElement(element); } }, copyToClipboard: async function(text) { try { await navigator.clipboard.writeText(text); return true; } catch (err) { console.error('Failed to copy:', err); return false; } } }; ```