Manifesto.RazorKit 0.1.0

dotnet add package Manifesto.RazorKit --version 0.1.0
                    
NuGet\Install-Package Manifesto.RazorKit -Version 0.1.0
                    
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="Manifesto.RazorKit" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Manifesto.RazorKit" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Manifesto.RazorKit" />
                    
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 Manifesto.RazorKit --version 0.1.0
                    
#r "nuget: Manifesto.RazorKit, 0.1.0"
                    
#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 Manifesto.RazorKit@0.1.0
                    
#: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=Manifesto.RazorKit&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Manifesto.RazorKit&version=0.1.0
                    
Install as a Cake Tool

<div align="center">

<picture> <source media="(prefers-color-scheme: dark)" srcset="razorkit-logo-black.png"> <source media="(prefers-color-scheme: light)" srcset="razorkit-logo-white.png"> <img src="razorkit-logo-white.png" alt="RazorKit logo" width="240"> </picture>

A component preview and development tool for ASP.NET Core Razor components

Inspired by Storybook, built for .NET developers

Build Status NuGet Version NuGet Downloads License .NET

GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests Contributors Last Commit

FeaturesInstallationQuick StartDocumentationContributingLicense

</div>


Overview

RazorKit brings the component-driven development experience to ASP.NET Core Razor applications. Develop, test, and document your UI components in isolation within your running application using an interactive preview environment—without navigating through the full application flow.

Features

  • 🎨 Interactive Component Preview — View and interact with Razor components in isolation
  • Real-time Property Editor — Dynamically modify component props and see changes instantly
  • 📚 Story Support — Define multiple states and variants for each component
  • Accessibility Testing — Built-in axe-core integration for automated a11y validation
  • 📱 Responsive Testing — Preview components at different viewport sizes
  • 🔍 Component Discovery — Automatically discovers components in your project
  • 🏗️ Atomic Design Support — Organize components using Atomic Design methodology

Installation

Requirements

Package Installation

dotnet add package Manifesto.RazorKit

Or add to your .csproj:

<PackageReference Include="Manifesto.RazorKit" Version="0.0.1" />

Quick Start

1. Register Services

Add RazorKit to your ASP.NET Core application in Program.cs:

using Manifesto.RazorKit.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Add Razor Pages (required for RazorKit UI)
builder.Services.AddRazorPages();

// Add RazorKit services
builder.Services.AddRazorKit(options =>
{
    options.ComponentLibraryName = "YourProject.Components";
});

var app = builder.Build();

// Map RazorKit routes
app.MapControllers();
app.MapRazorPages();

app.Run();

2. Define Component Props

Create a props class for your component:

public class ButtonProps
{
    public string Text { get; set; } = "Click me";
    public string Variant { get; set; } = "primary";
    public bool Disabled { get; set; } = false;
}

3. Create Stories

Define stories to showcase different component states:

using Manifesto.RazorKit.Models;

public class ButtonStories : ComponentStoriesBase<ButtonProps>
{
    public override string ComponentName => "Button";

    public override List<ComponentStory> GetStories()
    {
        return new List<ComponentStory>
        {
            CreateStory("primary", "Primary Button", "Default primary button", new ButtonProps
            {
                Text = "Primary",
                Variant = "primary"
            }),
            CreateStory("secondary", "Secondary Button", "Secondary variant", new ButtonProps
            {
                Text = "Secondary",
                Variant = "secondary"
            }),
            CreateStory("disabled", "Disabled State", "Disabled button", new ButtonProps
            {
                Text = "Disabled",
                Disabled = true
            })
        };
    }
}

4. Launch RazorKit

Start your application and navigate to /razorkit to view your components.

Documentation

Component Organization

RazorKit supports Atomic Design principles:

Components/
├── Atoms/
│   └── Button/
│       ├── Button.cshtml
│       ├── ButtonProps.cs
│       └── ButtonStories.cs
├── Molecules/
├── Organisms/
└── Templates/

Configuration Options

Component Library Name

Configure the component library name to specify static asset paths in the preview HTML:

builder.Services.AddRazorKit(options =>
{
    options.ComponentLibraryName = "YourProject.Components";
});

This generates preview HTML with paths like:

  • /_content/YourProject.Components/css/main.css
  • /_content/YourProject.Components/js/main.js
Custom Component Discovery

Implement IComponentDiscovery to customize how components are discovered:

public class CustomComponentDiscovery : IComponentDiscovery
{
    public List<ComponentInfo> DiscoverComponents()
    {
        // Your custom discovery logic
    }
}

// Register in Program.cs
builder.Services.AddRazorKit(options =>
{
    options.UseCustomDiscovery<CustomComponentDiscovery>();
});

Umbraco Integration

For Umbraco CMS projects, see Umbraco Setup Guide for detailed integration instructions.

<details> <summary>Quick Umbraco Setup</summary>

Create a Composer to register RazorKit services:

using Manifesto.RazorKit.Extensions;
using Umbraco.Cms.Core.Composing;

namespace YourProject.Composers;

public class RazorKitComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.Services.AddRazorKit(options =>
        {
            options.ComponentLibraryName = "YourProject.UmbracoComponents";
        });
    }
}

</details>

Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Setting up the development environment
  • Submitting pull requests
  • Coding standards and guidelines
  • Publishing new versions

Support

Roadmap

  • Visual regression testing integration
  • Dark mode support
  • Component documentation generation
  • Plugin system for custom addons

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments


<div align="center">

⬆ Back to Top

</div>

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 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
0.1.0 278 3/3/2026
0.0.1 1,879 12/17/2025