Umbraco.Community.BlockPreview 4.2.1

Suggested Alternatives

Umbraco.Community.BlockPreview 4.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Umbraco.Community.BlockPreview --version 4.2.1
                    
NuGet\Install-Package Umbraco.Community.BlockPreview -Version 4.2.1
                    
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="Umbraco.Community.BlockPreview" Version="4.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Umbraco.Community.BlockPreview" Version="4.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Umbraco.Community.BlockPreview" />
                    
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 Umbraco.Community.BlockPreview --version 4.2.1
                    
#r "nuget: Umbraco.Community.BlockPreview, 4.2.1"
                    
#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 Umbraco.Community.BlockPreview@4.2.1
                    
#: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=Umbraco.Community.BlockPreview&version=4.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Umbraco.Community.BlockPreview&version=4.2.1
                    
Install as a Cake Tool

BlockPreview

Platform NuGet GitHub

BlockPreview enables easy to use rich HTML backoffice previews for the Umbraco Block Grid, Block List and Rich Text editors, with full support for both Razor views and ViewComponents.

<img src="https://raw.githubusercontent.com/rickbutterfield/Umbraco.Community.BlockPreview/develop/.github/assets/icon.png" alt="Umbraco.Community.BlockPreview icon" height="150" align="right">

Supported Versions

v5.x supports Umbraco v17

v4.x supports Umbraco v16

v1.x supports Umbraco v10.x - v13.x

To understand more about which Umbraco CMS versions are actively supported by Umbraco HQ, please see Umbraco's Long-term Support (LTS) and End-of-Life (EOL) policy.

Installation

The Umbraco v17 version of this package is available via NuGet.

To install the package, you can use either .NET CLI:

dotnet add package Umbraco.Community.BlockPreview --version 5.0.0

or the NuGet Package Manager:

Install-Package Umbraco.Community.BlockPreview -Version 5.0.0

Quick Start

BlockPreview requires strongly-typed models (classes with the [PublishedModel] attribute) to be compiled into your application.

Supported configurations:

  • SourceCodeAuto or SourceCodeManual - Models are generated as .cs files and compiled into your assembly
  • InMemoryAuto - Models are generated at runtime (development only, requires Umbraco.Cms.DevelopmentMode.Backoffice)

If you are using Limbo.Umbraco.ModelsBuilder, the default configuration is to have ModelsMode set to nothing. Once configured, generate models in the backoffice as normal.

Once models are compiled into your assembly, you can deploy with ModelsMode=Nothing to disable runtime regeneration - the compiled model types will still work with BlockPreview.

BlockPreview can be configured in the Program.cs file, before the call to the .Build() method:

+using Umbraco.Community.BlockPreview.Extensions;

builder.CreateUmbracoBuilder()
    .AddBackOffice()
    .AddWebsite()
    .AddDeliveryApi()
    .AddComposers()
+   .AddBlockPreview(options =>
+   {
+       options.BlockGrid = new()
+       {
+           Enabled = true,
+           ContentTypes = [RichTextBlock.ModelTypeAlias]
+       };
+
+       options.BlockList = new()
+       {
+           Enabled = true
+       };
+
+       options.RichText.Enabled = false;
+   })
    .Build();

Alternatively, it can be configured in appsettings.json:

{
  "BlockPreview": {
    "BlockGrid": {
      "Enabled": true,
      "ContentTypes": ["richTextBlock"]
    },
    "BlockList": {
      "Enabled": true
    },
    "RichText": {
      "Enabled": false
    }
  }
}

Documentation

📖 Configuration Guide - Detailed configuration options, custom view locations, and stylesheet loading

📖 Usage Guide - How to use BlockPreview in your views and editors

📖 Advanced Customization - Custom services, request enrichers, and extensibility

Contribution Guidelines

To raise a new bug, create an issue on the GitHub repository. To fix a bug or add new features, fork the repository and send a pull request with your changes. Feel free to add ideas to the repository's issues list if you would to discuss anything related to the library.

Using the Test Sites

The repo comes with a test site for Umbraco 17. The site is configured with uSync out of the box to get you up and running with a test site quickly. Use the following credentials to log into the back office:

Username: admin@example.com
Password: 1234567890

Who do I talk to?

This project is maintained by Rick Butterfield and contributors. If you have any questions about the project please get in touch on Bluesky, or by raising an issue on GitHub.

Credits

This package is entirely based on the amazing work done by Dave Woestenborghs for 24days in Umbraco 2021. His code has been extended to support the new Block Grid editor in v10.4+ and turned into this package.

Matthew Wise also wrote a great article for 24days in Umbraco 2022 which added the ability to surface ViewComponents and has allowed his code to be contributed.

Ben White contributed the RequestEnricher allowing users to customise View Location and runtime stylesheet loading.

License

Copyright © 2022-2025 Rick Butterfield, and other contributors.

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (4)

Showing the top 4 NuGet packages that depend on Umbraco.Community.BlockPreview:

Package Downloads
LittleNorth.Igloo

Igloo is a highly customizable theme for Umbraco CMS.

Umbraco.Community.Templates.UmBootstrap

A project template for creating a new Umbraco site using the UmBootstrap Starter Kit

Our.Umbraco.BlockPreview

Easy to use rich HTML backoffice previews for the Umbraco Block List and Block Grid editors

Our.Community.CustomForm

Custom forms add-on for UmBootstrap

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.3.2 88 2/12/2026
5.3.1 51 2/12/2026 5.3.1 is deprecated because it has critical bugs.
5.3.0 52 2/12/2026 5.3.0 is deprecated because it has critical bugs.
5.2.1 979 1/23/2026
5.2.0 237 1/22/2026
5.1.0 955 1/8/2026
5.0.0 2,801 11/27/2025
5.0.0-rc3 273 11/26/2025
5.0.0-rc2.2 264 11/14/2025
5.0.0-rc2.1 216 11/14/2025
4.2.2 31 2/12/2026
4.2.1 43 2/12/2026 4.2.1 is deprecated because it has critical bugs.
4.2.0 46 2/12/2026 4.2.0 is deprecated because it has critical bugs.
4.1.1 230 1/23/2026
4.1.0 100 1/22/2026
4.0.7 119 1/8/2026
4.0.6 775 11/27/2025
1.14.0 484 1/8/2026
Loading failed