Blazorise Documentation

repository·master·Indexed 26 days ago

https://github.com/megabit/blazorise

A source-available UI component library for .NET Blazor applications providing a strongly-typed C# API. Blazorise is provider-agnostic and supports multiple CSS frameworks including Bootstrap, Bootstrap 5, Tailwind, Bulma, Material, AntDesign, and FluentUI2. The documentation covers installation, service registration, component usage, and details on the Blazorise Docs MCP Server and ApiDocsGenerator.

Tokens
8.4K
Snippets
26
Records
62
Agent score
75%

What's inside Blazorise

  1. Understand the Blazorise.AntDesign Mental Model

    master

    The Blazorise.AntDesign provider is designed to provide the visual language and behavior of Ant Design v6 within the Blazorise component framework. It is not a literal port of Ant Design React, but rather a mapping that aims to reproduce rendered behavior and appearance.

    It operates across three layers:

    1. Blazorise component API: The standard Blazorise interface you interact with.
    2. AntDesign provider mapping: The logic that maps Blazorise components to AntD structures.
    3. Ant Design v6 visual language: The CSS and tokens that provide the look and feel.

    Note that some components may use native browser controls under an AntD shell or require provider-specific Razor components to bridge the gap between Blazorise markup and AntD requirements.

  2. Understand Blazorise Weaver architecture

    master

    Blazorise uses Fody for weaving logic, split into two components:

    • Blazorise.Weavers (bw): A wrapper project that exists to create the necessary NuGet package (including Fody.Packaging) required for Fody to function. It is not intended to be used directly but acts as the packaging mechanism.
    • Blazorise.Weavers.Fody (bwf): The core implementation containing the actual weaving logic. This project is not referenced directly by other projects to avoid Ambiguous package name errors, as the resulting NuGet package shares the same name as the project.
  3. Configure Animate component triggers and visibility

    master

    The Animate component supports several trigger and visibility behaviors:

    • Viewport Triggering (Default): Animations are triggered based on viewport entry to preserve scroll-reveal behavior.
    • Immediate Render: Use AnimationTrigger.Render for animations that should run immediately after the component renders.
    • Visibility Transitions: Use the Visible property for enter/leave animations without needing an @if block. When Visible is false, the component maintains its rendered content until the exit animation completes.
    • Initial Render Control: Set AnimateOnInitialRender to false if content should appear immediately on page load and only animate during subsequent visibility changes.
    • Size Animation: Set AnimatedSize to AnimatedSize.Width or AnimatedSize.Height to animate the element's occupied space (useful for sidebars or drawers) instead of using a transform-only animation.
  4. Build and Publish Blazorise NuGet packages

    master

    To build and publish the Blazorise NuGet packages, execute the following batch files in sequence from the repository root:

    1. Run dotnet-pack.bat to pack the packages.
    2. Run push.bat to publish the packed NuGet packages.
    dotnet-pack.bat
    push.bat
  5. Generate Source Generator files to a fixed folder

    master

    By default, source-generated files are held in memory. To write the generated files to a specific directory on your disk for inspection or use, configure the EmitCompilerGeneratedFiles and CompilerGeneratedFilesOutputPath properties in your .csproj file.

    <PropertyGroup>
    	<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    	<CompilerGeneratedFilesOutputPath>__SOURCEGENERATED__</CompilerGeneratedFilesOutputPath>
    </PropertyGroup>