Installation
Get started with the StellarAdmin Tag Helpers
Add to existing project
The following installation instructions assume you are adding StellarAdmin to an existing ASP.NET Core MVC or Razor Pages project.
Install package
Install the StellarAdmin.TagHelpers NuGet package.
dotnet add package StellarAdmin.TagHelpersRegister services
Update your Program.cs (or Startup.cs) to register the StellarAdmin services.
using StellarAdmin;
using StellarAdmin.TagHelpers;
builder.Services.AddStellarAdmin().AddTagHelpers();Update imports
Update your _ViewImports.cshtml to register the StellarAdmin Tag Helpers and import the StellarAdmin.TagHelpers namespace.
@using StellarAdmin.TagHelpers
@addTagHelper *, StellarAdmin.TagHelpersAdd stylesheet and JavaScript file
Add the StellarAdmin stylesheet and the StellarAdmin JavaScript file to your Razor page. The stylesheet carries every component and the default theme.
<!DOCTYPE html>
<html lang="en">
<head>
...
<link rel="stylesheet" href="/_content/StellarAdmin.TagHelpers/stellar-admin.css" asp-append-version="true"/>
<script defer src="/_content/StellarAdmin.TagHelpers/stellar-admin.js" asp-append-version="true"></script>
</head>
<body>
...
</body>
</html>To change the default theme, create a theme file in the theme builder and link it after the stylesheet. The Theming page provides more information on theming.
Start using the Tag Helpers
Start using the StellarAdmin Tag Helpers inside your Razor Pages or MVC Views. For example, the code snippet below adds an alert to your page.
<sa-alert>
<sa-alert-title>Success! You have configured StellarAdmin correctly.</sa-alert-title>
</sa-alert>Before you start using the components, read the Conventions page. It covers the rules every Tag Helper follows for attribute pass-through, custom classes, model binding and links.
Starter Templates
Coming soon...