Soenneker.Blazor.Masonry 4.0.2461

Prefix Reserved
dotnet add package Soenneker.Blazor.Masonry --version 4.0.2461
                    
NuGet\Install-Package Soenneker.Blazor.Masonry -Version 4.0.2461
                    
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="4.0.2461" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Masonry" Version="4.0.2461" />
                    
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 4.0.2461
                    
#r "nuget: Soenneker.Blazor.Masonry, 4.0.2461"
                    
#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@4.0.2461
                    
#: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=4.0.2461
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Masonry&version=4.0.2461
                    
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 net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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
4.0.2461 0 9/30/2026
4.0.2460 34 9/29/2026
4.0.2459 40 9/29/2026
4.0.2458 45 9/29/2026
4.0.2457 42 9/29/2026
4.0.2456 65 9/25/2026
4.0.2455 64 9/25/2026
4.0.2454 58 9/25/2026
4.0.2453 61 9/24/2026
4.0.2452 65 9/24/2026
4.0.2451 63 9/24/2026
4.0.2450 61 9/24/2026
4.0.2449 135 9/16/2026
4.0.2448 116 9/16/2026
4.0.2447 95 9/16/2026
4.0.2446 93 9/16/2026
4.0.2445 88 9/16/2026
4.0.2443 89 9/15/2026
4.0.2440 92 9/14/2026
4.0.2439 94 9/13/2026
Loading failed

Updated Soenneker.Lepton.Suite to 4.0.92