Installation
Add StellarAdmin.UI to an ASP.NET Core app
To install StellarAdmin.UI, you need an ASP.NET Core MVC or Razor Pages app running on .NET 10 or later.
Register the services
Call AddStellarAdminUI() in Program.cs to register the services the Tag Helpers need.
using StellarAdmin.UI;
builder.Services.AddStellarAdminUI();AddStellarAdminUI() changes the MVC options for your whole app, including pages that don't use StellarAdmin.UI. It adds a model binder and a value provider that bind checkbox groups, and a global result filter that sends queued toasts in a response header for fetch and XHR requests.
Register the Tag Helpers
Add the following lines to your _ViewImports.cshtml to register the Tag Helpers and import the StellarAdmin.UI namespace:
@using StellarAdmin.UI
@addTagHelper *, StellarAdmin.UIAdd the stylesheet and the script
Add the StellarAdmin.UI stylesheet and script to the <head> of your layout. The stylesheet contains the styles of every component and the default theme.
<!DOCTYPE html>
<html lang="en">
<head>
...
<link rel="stylesheet" href="/_content/StellarAdmin.UI/stellar-admin.css" asp-append-version="true"/>
<script type="module" src="/_content/StellarAdmin.UI/stellar-admin.js" asp-append-version="true"></script>
</head>
<body>
...
</body>
</html>To give your app its own look, create a theme file in the theme builder and link it after the stylesheet. See theming for more.
Use the Tag Helpers
Add a Tag Helper to one of your pages or views to check that everything works. The example below adds an alert:
<sa-alert>
<sa-alert-title>StellarAdmin.UI is installed.</sa-alert-title>
</sa-alert>Next steps
Read the conventions that all the Tag Helpers follow, then browse the components in the sidebar.