Soenneker.Blazor.Masonry 11.0.2594

Prefix Reserved
dotnet add package Soenneker.Blazor.Masonry --version 11.0.2594
                    
NuGet\Install-Package Soenneker.Blazor.Masonry -Version 11.0.2594
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Blazor.Masonry" Version="11.0.2594" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Masonry" Version="11.0.2594" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Masonry" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Blazor.Masonry --version 11.0.2594
                    
#r "nuget: Soenneker.Blazor.Masonry, 11.0.2594"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Blazor.Masonry@11.0.2594
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Blazor.Masonry&version=11.0.2594
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Masonry&version=11.0.2594
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blazor.Masonry

Blazor components and interop for arranging variable-height items with Masonry.

Installation

dotnet add package Soenneker.Blazor.Masonry
using Soenneker.Blazor.Masonry.Registrars;

builder.Services.AddMasonryInteropAsScoped();

Add the component namespace to _Imports.razor:

@using Soenneker.Blazor.Masonry

Automatic layout

<Masonry class="row" SizerClass="col-sm-6 col-lg-4">
    @foreach (Card card in cards)
    {
        <MasonryItem class="col-sm-6 col-lg-4 mb-3">
            <article class="card">
                <h2>@card.Title</h2>
                <p>@card.Description</p>
            </article>
        </MasonryItem>
    }
</Masonry>

MasonryItem always appends the masonry-item class. When SizerClass is supplied, the container renders an empty .masonry-sizer element with those width classes and uses it as the column width. The library does not include Bootstrap; the example classes work only when the application supplies Bootstrap or equivalent CSS.

Automatic initialization runs after the first render. It works best when item dimensions are already stable.

Images and changing content

Images can change item height after Masonry's first measurement. Initialize only after the images are ready, or call Layout() from the image load path:

<Masonry @ref="_masonry"
         AutoRender="false"
         SizerClass="gallery-column">
    @foreach (Photo photo in photos)
    {
        <MasonryItem class="gallery-column">
            <img src="@photo.Url" alt="@photo.Alt" @onload="ImageLoaded" />
        </MasonryItem>
    }
</Masonry>

@code {
    private Masonry? _masonry;
    private int _loadedImages;
    private bool _initialized;

    private async Task ImageLoaded()
    {
        _loadedImages++;

        if (_loadedImages == photos.Count)
        {
            await _masonry!.Init();
            _initialized = true;
        }
        else if (_initialized)
            await _masonry!.Layout();
    }
}

When adding or removing rendered items after initialization, call Layout() after Blazor has rendered the new DOM. The built-in observer watches removal of the entire Masonry container for cleanup; it does not automatically re-layout child mutations or image loads.

Asset source

The component loads a pinned Masonry script from jsDelivr with an integrity check. For direct interop usage, Warmup(useCdn: false) or Init(..., useCdn: false) selects the packaged script instead. The scoped loader initializes once, so use the same source choice throughout a scope.

Most applications should use the components. IMasonryInterop is available to custom wrapper authors and supports Init, Layout, CreateObserver, and Destroy by element ID. Invalid selectors and calls to Layout before initialization surface as JavaScript interop errors rather than being silently ignored.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.2594 118 11/19/2026
11.0.2593 104 11/19/2026
11.0.2592 98 11/19/2026
11.0.2590 96 11/19/2026
11.0.2589 89 11/19/2026
11.0.2588 91 11/19/2026
11.0.2587 99 11/18/2026
11.0.2586 98 11/18/2026
11.0.2585 95 11/18/2026
11.0.2584 101 11/18/2026
11.0.2583 97 11/18/2026
11.0.2580 102 11/18/2026
11.0.2579 102 11/17/2026
11.0.2578 100 11/16/2026
11.0.2576 101 11/16/2026
11.0.2575 100 11/16/2026
11.0.2573 107 11/15/2026
11.0.2572 106 11/15/2026
11.0.2571 105 11/15/2026
11.0.2570 104 11/15/2026
Loading failed

Updated Soenneker.Blazor.Utils.ResourceLoader to 11.0.1859