Branding

Set the admin panel's name and logo

To configure the admin panel's name and logo, call ConfigureBranding(). These are displayed at the top of the sidebar:

using StellarAdmin.Sidebar;

admin.ConfigureBranding(branding =>
{
    branding.Title = "Voyager Travel";
    branding.Subtitle = "Admin";
    branding.Logo = BrandingLogo.Icon("compass");
});
The top of the sidebar, with a compass icon, the Voyager Travel title and the Admin subtitle

The branding builder has the following members:

MemberDescription
TitleSets the admin panel's name. The default is derived from your app's name, for example, an app named Voyager.Admin will result in the name "Voyager Admin".
SubtitleSets a second line under the title. The default is none.
LogoSets the logo. The default is none, which displays the title on its own.
HrefSets the URL that the title and logo link to: an absolute URL, or a path in your app that starts with ~/. The default is the admin panel's home page.

The browser tab also displays the title after the page's name, such as "Bookings - Voyager Travel".

To set the logo, set Logo to one of the following:

Logo TypeDescription
BrandingLogo.Icon(name)Displays an icon in a colored tile, beside the title.
BrandingLogo.Image(path)Displays a square image beside the title.
BrandingLogo.Wordmark(path)Displays an image in place of the title and the subtitle, with the title as its alt text.
The top of the sidebar with each kind of logo: No logo
No logo
The top of the sidebar with each kind of logo: Icon
Icon
The top of the sidebar with each kind of logo: Image
Image
The top of the sidebar with each kind of logo: Wordmark
Wordmark

The path is an absolute URL, or a path in your app that starts with ~/. You can specify an second image to be displayed in dark mode by passing it as the darkPath parameter of Image() or Wordmark():

branding.Logo = BrandingLogo.Wordmark("~/img/wordmark.svg", "~/img/wordmark-dark.svg");

Placing a wordmark

StellarAdmin centers a wordmark, at the height of the title and the subtitle it replaces. To change the layout and placement, pass a WordmarkLayout as the last argument of Wordmark(). The example below stretches a wide wordmark across the sidebar, so it doesn't look small:

branding.Logo = BrandingLogo.Wordmark("~/img/wordmark.svg", WordmarkLayout.Fill);

The layout can be one of the following:

LayoutDescription
WordmarkLayout.CenterCenters the wordmark. This is the default.
WordmarkLayout.StartLines the wordmark up with the sidebar items.
WordmarkLayout.FillStretches the wordmark across the sidebar, up to twice its height.
A wordmark at the top of the sidebar in each layout: Center
Center
A wordmark at the top of the sidebar in each layout: Start
Start
A wordmark at the top of the sidebar in each layout: Fill
Fill

Replacing the top of the sidebar

When the settings can't produce the design you want, add your own Areas/StellarAdmin/Views/Shared/_SidebarBrand.cshtml to your app, which replaces StellarAdmin's. The view's model is a SidebarBrandModel, with the Title, Subtitle, Logo and Href you configured. The folder needs the view imports.

On this page