HeroSection
HeroSection renders the header of a page: a title, a subtitle, a summary, up to two buttons and an image, either
beside the text or behind it. The CMS page components (ArticlePage, HomePage, LandingPage) use it for their
headers, and you can use it on your own Razor pages.
Package Osirion.Blazor.Core, namespace Osirion.Blazor.Components. Source on GitHub.
Osirion.Blazor
Server-rendered Blazor components for content sites
Every component renders complete HTML before any script runs.

@using Osirion.Blazor.Components
@* The title is TitleContent so the demo adds an h2, not a second h1, to the documentation page *@
<HeroSection MinHeight="18rem"
Subtitle="Server-rendered Blazor components for content sites"
Summary="Every component renders complete HTML before any script runs."
ImageUrl="/images/osirion-hero.png"
ImageAlt="An illustration of a browser window showing the Blazor logo, on a purple background"
PrimaryButtonText="Read the docs"
PrimaryButtonUrl="/docs"
SecondaryButtonText="Source on GitHub"
SecondaryButtonUrl="https://github.com/demonjic/Osirion.Blazor">
<TitleContent>
<h2 class="osirion-hero-title">Osirion.Blazor</h2>
</TitleContent>
</HeroSection>Usage
<HeroSection Title="Release notes" Subtitle="What changed in each version" />
A landing page header with a side image, two buttons and a background pattern:
<HeroSection Title="Osirion.Blazor"
Subtitle="SSR-first Blazor components for content sites"
ImageUrl="/assets/images/blazor-cover.png"
ImageAlt=""
BackgroundPattern="BackgroundPatternType.Grid"
PrimaryButtonText="Read the docs"
PrimaryButtonUrl="/docs"
SecondaryButtonText="Source on GitHub"
SecondaryButtonUrl="https://github.com/demonjic/Osirion.Blazor" />
An article header with the image behind the text and the author, date and reading time:
<HeroSection Title="Static SSR with Blazor"
Subtitle="What renders on the server, and what needs interactivity"
ImageUrl="/assets/images/blazor-cover.png"
UseBackgroundImage="true"
HasOverlay="true"
Alignment="Alignment.Center"
ShowMetadata="true"
Author="Dejan Demonjić"
PublishDate="@(new DateTime(2026, 10, 11))"
ReadTime="6"
MinHeight="40vh" />
A product page header: a short label above the title (Eyebrow), three phrases behind check marks under the summary
(Highlights), and the screenshot in a browser-like frame (FrameImage). Available from 4.3.
Component library
Build the site, not the parts
Server-rendered Blazor components for content sites.
- Complete HTML before any script
- Light and dark themes
- Bootstrap, Fluent UI and MudBlazor

@using Osirion.Blazor.Components
@* The title is TitleContent so the demo adds an h2, not a second h1, to the documentation page *@
<HeroSection MinHeight="18rem"
Eyebrow="Component library"
Summary="Server-rendered Blazor components for content sites."
Highlights="@(["Complete HTML before any script", "Light and dark themes", "Bootstrap, Fluent UI and MudBlazor"])"
ImageUrl="/images/osirion-hero.png"
ImageAlt="An illustration of a browser window showing the Blazor logo, on a purple background"
FrameImage="true"
PrimaryButtonText="Read the docs"
PrimaryButtonUrl="/docs">
<TitleContent>
<h2 class="osirion-hero-title">Build the site, not the parts</h2>
</TitleContent>
</HeroSection><HeroSection Eyebrow="Component library"
Title="Build the site, not the parts"
Summary="Server-rendered Blazor components for content sites."
Highlights="@(["Complete HTML before any script", "Light and dark themes"])"
ImageUrl="/images/screenshot.png"
ImageAlt="The dashboard with three open orders"
FrameImage="true"
PrimaryButtonText="Read the docs"
PrimaryButtonUrl="/docs" />
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
Title |
string? |
null |
The main heading, rendered as an h1 with the class osirion-hero-title. Ignored when TitleContent is set. |
TitleContent |
RenderFragment? |
null |
Your own heading markup in place of Title, for when the page needs another heading level. |
Subtitle |
string? |
null |
The line under the title, rendered as a paragraph. Ignored when SubtitleContent is set. |
SubtitleContent |
RenderFragment? |
null |
Your own markup in place of Subtitle. |
Summary |
string? |
null |
A longer paragraph under the subtitle. Ignored when SummaryContent is set. |
SummaryContent |
RenderFragment? |
null |
Your own markup in place of Summary. |
Eyebrow |
string? |
null |
A short label above the title, such as New or the product's category, as plain text in a paragraph with the class osirion-hero-eyebrow. |
Highlights |
IReadOnlyList<string>? |
null |
Short phrases shown under the summary, each behind a check mark, as an OsirionChecklist inside a div with the class osirion-hero-highlights. Empty phrases are left out. |
FrameImage |
bool |
false |
Whether the side image sits in a subtle browser-like frame (a bar with three dots above it, a border and a shadow), for a product screenshot. Has no effect on a background image. |
Aside |
RenderFragment? |
null |
Content shown beside the copy instead of the side image, such as a sample record or a short checklist, in a div with the class osirion-hero-aside: on the right on wide screens and below the copy on narrow ones. When it is set, the side image (and FrameImage) is not shown; a background image still is, and keeps the section in one column, so the aside sits below the copy. |
ImageUrl |
string? |
null |
The image, shown beside the text or, with UseBackgroundImage, behind it. As a background it is CSS-escaped before it is written to the inline style. |
ImageAlt |
string? |
null |
The side image's alternative text; when it is not set, Title is used, then Hero image. Pass an empty string for a decorative image. A background image has no alternative text. |
UseBackgroundImage |
bool |
false |
Whether ImageUrl is the section's background image instead of a side image. |
HasOverlay |
bool |
false |
Whether a 40% black overlay is drawn over a background image and the text turns white. Has no effect without UseBackgroundImage and ImageUrl. |
BackgroundPattern |
BackgroundPatternType? |
null |
A decorative pattern behind the content, drawn unless UseBackgroundImage is on. |
Alignment |
Alignment |
Alignment.Left |
The text alignment: Left, Center or Right. Justify is treated as Left. |
ShowPrimaryButton |
bool |
true |
Whether the primary button is rendered; it also needs PrimaryButtonText and PrimaryButtonUrl. |
ShowSecondaryButton |
bool |
true |
Whether the secondary button is rendered; it also needs SecondaryButtonText and SecondaryButtonUrl. |
PrimaryButtonText |
string? |
null |
The primary button's text. |
PrimaryButtonUrl |
string? |
null |
The primary button's address, written as given, so pass an address your application controls. |
SecondaryButtonText |
string? |
null |
The secondary button's text. |
SecondaryButtonUrl |
string? |
null |
The secondary button's address, written as given, so pass an address your application controls. |
BackgroundColor |
string? |
null |
A CSS color for the section's background, written to the inline style as given. |
TextColor |
string? |
null |
A CSS color for the section's text, written to the inline style as given. |
MinHeight |
string |
"60vh" |
The section's minimum height as a CSS length. The default, 60vh, comes from the stylesheet; another value is written to the inline style as given. |
Author |
string? |
null |
The author name shown in the metadata line when ShowMetadata is on. |
PublishDate |
DateTime? |
null |
The publication date shown in the metadata line when ShowMetadata is on. |
Culture |
CultureInfo? |
null |
The culture PublishDate is written in, normally the language of the page. When null, the current culture is used. |
ReadTime |
string? |
null |
The reading time in minutes, shown in the metadata line when ShowMetadata is on: 6 is shown as 6 min. |
ShowMetadata |
bool |
false |
Whether Author, PublishDate and ReadTime are shown under the text. |
ImagePosition |
Alignment |
Alignment.Right |
The side of the text the side image sits on. Left and Justify are treated as Right, so the image is always on the right. |
Variant |
HeroVariant |
HeroVariant.Hero |
Hero, Jumbotron or Minimal: changes the spacing, the text sizes and the side image's size. |
ChildContent |
RenderFragment? |
null |
Extra content under the buttons, in a div with the class osirion-hero-additional. |
HasDivider |
bool |
true |
Whether a shadow in the primary color is drawn along the section's top edge. |
Theme |
ThemeMode |
ThemeMode.System |
The component's color mode. Light or Dark writes it to data-theme (data-bs-theme under Bootstrap) on the root element; System writes nothing. |
Class |
string? |
null |
Extra CSS classes for the component's root element. |
Style |
string? |
null |
An inline style for the component's root element. |
Unmatched attributes are written to the <section>.
Behavior
- The component renders plain HTML and needs no script.
Titleis an<h1>. A page should have one, so when the page already has its main heading, passTitleContentwith the level you need.- Text parameters are HTML-encoded. Button addresses are written as given, so pass addresses you control.
ImageUrlis CSS-escaped when it becomes a background image (since 4.0), so a front matterfeatured_imagecannot close theurl()and add declarations.- The side image carries
widthandheightattributes for its variant (600 by 315 forHero, 600 by 600 forJumbotron, 315 by 315 forMinimal) to avoid layout shift, andfetchpriority="high"because it is usually the largest element in view. Culturesets the language of the date in the metadata line; without it the current culture is used.- A button is rendered only when it is shown and has both its text and its address.
- The buttons take the configured CSS framework's primary and secondary button classes in the large size
(
btn btn-primary btn-lgandbtn btn-secondary btn-lgunder Bootstrap). The secondary classes come fromButtonClasses.SecondaryinOsirion.Blazor.Core.Utils, like the secondary button of OsirionCallToActionSection, so the two sections' buttons look the same. Up to 4.2.0 the secondary button had the outlined primary classes. - A background image has no alternative text, so use it for decoration only. The side image has
ImageAlt. - A background pattern is drawn unless
UseBackgroundImageis on. Eyebrowis a paragraph before the title, plain text and HTML-encoded.Highlightsrender as an OsirionChecklist after the summary and before the buttons; empty phrases are left out, and each check mark is hidden from assistive technology.FrameImageadds a decorative bar with three dots above the side image (aria-hidden="true"), so the image keeps its own alternative text. With none of the three set, the hero renders the markup it rendered before they existed.Asideshows content of your own beside the copy instead of the side image, such as a sample record: on the right from 768px and below the copy on narrower screens. WhenAsideandImageUrlare both set, the aside wins and the side image andFrameImageare not shown; a background image still shows, and the aside sits below the copy.
Styling
The <section> has osirion-hero-section, osirion-hero-variant-{hero|jumbotron|minimal} and
osirion-hero-align-{left|center|right}, plus osirion-hero-with-background and osirion-hero-with-overlay, or
osirion-hero-with-side-image, depending on the image. Inside are osirion-hero-title, osirion-hero-subtitle,
osirion-hero-summary, osirion-hero-buttons, osirion-hero-additional and osirion-hero-image-container, and
from 4.3 osirion-hero-eyebrow, osirion-hero-highlights (around the checklist), osirion-hero-image-framed (on
the image container) and osirion-hero-image-frame-bar. Both
buttons carry osirion-hero-button; the primary button adds osirion-hero-button-primary and the secondary button
osirion-hero-button-secondary. Up to 4.2.0 the secondary button carried osirion-hero-button-primary too, so a
rule written for both buttons through that class should select osirion-hero-button instead.
The text sizes scale with the window between a minimum and a maximum, set as custom properties on the section:
--hero-title-min, --hero-title-pref, --hero-title-max and the same three for subtitle and summary. Set them
through Style:
<HeroSection Title="Changelog" Style="--hero-title-max: 3rem; --hero-subtitle-max: 1.125rem;" />
Colors come from --osirion-background-primary and --osirion-text-primary, the divider from
--osirion-color-primary-600. The eyebrow uses --osirion-link-color (white over the overlay). The frame has a
1px --osirion-border-color border, the --osirion-shadow-xl shadow and a bar in --osirion-background-tertiary;
inside it the image keeps its proportions and does not zoom on hover.