Getting Started
Get up and running with NeoUI in your Blazor project in minutes. No Tailwind CSS setup required.
New Project? Use the Template
1. Install the Package
Install NeoUI.Blazor from NuGet.
It automatically includes the Primitives layer and all three icon libraries.
2. Add Namespace Imports
Add the following to your _Imports.razor.
These two lines cover every styled component and service for most projects:
All components and their enums (e.g. ButtonVariant,
InputType) live in the single
NeoUI.Blazor namespace — no per-component imports needed.
Optional: Lucide Icons (highly recommended)
Optional: Primitives (for custom headless styling only)
Only add these if you are building your own styled components on top of the headless
Primitives layer.
They are not needed when using NeoUI.Blazor styled components.
Chart Components
@using NeoUI.Blazor.Charts
to any file or global imports file that uses chart components.
3. Register Services
Register the NeoUI services in both your server and WebAssembly
Program.cs files:
4. Add CSS References
Add the pre-built NeoUI stylesheet to your
App.razor.
The @Assets[...]
directive is the .NET 10 way to reference static web assets — it adds a fingerprint
hash to the URL for automatic cache invalidation on each deployment.
No Tailwind installation or build process required.
Dynamic Theme Switching
ThemeSwitcher
component (85 color combinations at runtime), include all base and primary theme files.
See the Theming guide for details.
5. Add Portal Hosts
Overlay and notification components render outside the component tree via a portal system.
Add all four hosts at the end of your main layout — after
@Body and outside any
scrollable or clipping container:
What Each Host Does
ToastViewport— renders toast notification messages. Position is configurable (e.g. BottomRight, TopCenter).DialogHost— required when usingDialogServicefor programmatic dialogs.ContainerPortalHost— inline overlays: Popover, Tooltip, DropdownMenu.OverlayPortalHost— full-screen overlays: Dialog, Sheet, Drawer.
6. Start Using Components
That's it — you're ready to build: