Skip to content

Docs: using ShellUI from a Razor class library shared by several hosts #53

Closed

Description

@Shewart

Summary

Putting ShellUI components in a Razor class library shared by a Blazor Server app and a MAUI Blazor Hybrid app works, but the setup isn't documented and several steps aren't obvious.

What a guide should cover

  • Hosts reference _content/<Library>/app.css and _content/<Library>/shellui.js, and must not copy the CSS into their own wwwroot.
  • Tailwind scans only the library, so classes used in a host's own markup need an @source line in input.css.
  • ThemeToggle assumes dark when nothing is stored and sets the dark class only after the first render, so each host needs the inline theme script that shellui init writes into a normal app's App.razor.
  • Hosts that keep the session in browser storage need prerender: false.

Possible CLI help

shellui init could detect a Razor class library (Microsoft.NET.Sdk.Razor with no Program.cs) and print these host steps.

Activity

  1. added a commit that references this issue on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions