BlazorBook 0.0.1-beta.3

This is a prerelease version of BlazorBook.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package BlazorBook --version 0.0.1-beta.3                
NuGet\Install-Package BlazorBook -Version 0.0.1-beta.3                
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="BlazorBook" Version="0.0.1-beta.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorBook --version 0.0.1-beta.3                
#r "nuget: BlazorBook, 0.0.1-beta.3"                
#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.
// Install BlazorBook as a Cake Addin
#addin nuget:?package=BlazorBook&version=0.0.1-beta.3&prerelease

// Install BlazorBook as a Cake Tool
#tool nuget:?package=BlazorBook&version=0.0.1-beta.3&prerelease                

blazor-book

A Storybook like UI for hosting Blazor components

<img src="https://www.allaneagle.com/blazorbook.gif?v=1" width="100%" />

Installation

The BlazorBook nuget package needs to be added to your Blazor WASM/Server app and your Razor Class library project containing your individual stories.

Install-Package BlazorBook -ProjectName MyProject

Setup

In the startup of your Blazor WASM/Server app:

app.RegisterAllStories(Assembly.Load("<<Assembly name containing stories>>"));

  • In _Imports.razor

Add @using BlazorBook.Components

  • In App.razor

    1. Add <BlazorBook.Resources /> to the top
    2. Add an AdditionalAssemblies prop on the <Router /> component as follows:
<Router
  AppAssembly="@typeof(App).Assembly"
  AdditionalAssemblies="new[] { typeof(BlazorBook.UI).Assembly }"
>
  ...
</Router>

The stories will be registered and the UI available on the path /blazorbook

Stories

Create a Razor Class Library to contain your stories. This should also have the BlazorBook nuget package as a dependency.

For example a story can be as follows:

HelloWorld.razor

@inherits BlazorBook.StoryComponent
@attribute [DisplayName("Story name")]

<div>Hello @(world)!</div>

@code {
    string world = "World!";
}
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. 
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.0.1-beta.4 347 9/25/2024
0.0.1-beta.3 84 4/23/2024
0.0.1-beta.2 1,136 2/28/2023
0.0.1-beta.1 157 8/13/2022