Proposal: a shadcn-style component registry + drift-aware CLI for Fluent Blazor — the missing half of "bring your own theme," and the unlock for AI-generated UI #5007
Replies: 1 comment 1 reply
-
|
Hi, First of all, thanks for your extensive proposal. There is a lot to unpack here! Before answering your 'questions for the maintainers', I want to repeat (or clarify maybe) what the status of this project is: We are a fully open-source, non-funded, project that lives in the It seems that to do what you propose, goes (well) beyond what we as maintainers have a say about. Your proposal and questions: I think what you propose (please correct me if I'm wrong) is to offer a way for developers to get component source code 'injected' into their own project/code. That is a whole (radically) different approach than what we know in the .NET and Blazor world currently where you just consume what is provided to you through a NuGet package. Yes, that may offer less customization, but on the other hand, it also protects the dev from missing to add auxiliary, required code (like a base class or service collection extensions, etc). Building in support for something in a successful way like that would require, I think, involvement form the .NET/ASP.NET Core/Blazor teams
You probably need all 3 of them. Global tool for the dev's local environment, NuGet to get the basic, shared, library components in place and a CLI (not sure if it must be npm based) to help use the things from the AI part of this.
I think this is a non-goal for the library at this moment because
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR
You've already solved the hard, unglamorous half of a modern design system: a full, granular design-token layer that most component libraries never bother to expose properly. The half that's still missing is the distribution model — the shadcn-style "copy the source into my repo, I own it, tell me when upstream drifts" workflow. Closing that gap would do more than improve DX; it would make Blazor + Fluent 2 the natural target for AI coding tools, which is almost certainly something Microsoft wants and doesn't yet have.
This is a discussion-starter, not a spec. I've tried to be honest about the parts that are genuinely hard (shadow DOM, the consistency-vs-ownership philosophy) rather than hand-wave them.
The half you've already nailed (and most libraries never do)
Credit where it's due — this is the part everyone underestimates:
FluentDesignThemefor declarative, layout-level configuration, plus per-elementSetValueFortargeting.Genuinely: the "bring your own tokens" story here is ahead of a lot of the React ecosystem. The token plumbing is done. That's the expensive part, and it's finished.
The half that's missing: the shadcn distribution model
shadcn/ui won the mindshare war not because the components are prettier, but because of how they're delivered:
npx shadcn add buttoncopies editable source into your repo. No package dependency, no version lock-in, no hidden abstraction. The file is yours the moment it lands.shadcn add --diffshows what changed upstream since you last pulled, so you merge improvements deliberately instead of being silently overwritten — or silently stuck.registry.json/registry-item.jsonitems served as plain JSON over HTTP. There are namespaced registries (@acme/button), private/authed registries, and — importantly — the registry format is explicitly framework-agnostic. It is not a React-only idea. It ships "any file types."Point 4 is the whole ballgame. AI agents are good at shadcn because the component is legible source the model can read and edit, plus a machine-readable registry describing what exists and how it composes. That's the loop you don't have yet.
Why this is a Microsoft-shaped opportunity
Here's the strategic argument, stated plainly:
Button → FluentButton, shadcn tokens → Fluent tokens — so an agent can port a shadcn-shaped app onto Blazor + Fluent 2 as a first-class skill.You've built the design system. This is the delivery mechanism that lets AI tools reach for it.
What it would concretely require
Roughly, adapting the shadcn toolchain to the .NET world:
style-dictionary-style pipeline that emits your Fluent tokens to multiple targets (CSS vars, C# constants, a JSON manifest agents can read). You already generate typed token classes — this is a generalization of that, made consumable outside the library.registry.jsonequivalent describing components, their token dependencies, and composition — served as static JSON. Framework doesn't matter to the schema; that's the point.dotnetglobal tool (dotnet fluent add datagrid,dotnet fluent diff) for people who live in the .NET toolchain, or an npm-based CLI that reuses shadcn's own registry plumbing so it's instantly familiar to the AI-tool ecosystem. (An honest question below: NuGet vs. dotnet-tool vs. npm.)The idea, visualized — a single component alone on a canvas, styled entirely by named tokens (
accent.base,corner.radius,control.density,font.body,theme.mode), with those tokens emitted as a machine-readable manifest an agent can consume. Same loop, .NET-native:Pros
--diff-style drift detection means teams pull improvements on their schedule instead of fearing a NuGet bump.Cons / open questions (the honest part)
dotnettool or an npm CLI fits better. Which one serves the goal — .NET-native ergonomics, or maximum reach into the AI-tool ecosystem that already speaks npm/shadcn?A possible phased path
--diffloop in .NET.Questions for the maintainers
dotnetglobal tool, NuGet, or npm-based CLI — which best serves both .NET devs and the AI-tool ecosystem?Beta Was this translation helpful? Give feedback.
All reactions