OsirionFeatureCard
OsirionFeatureCard renders an image next to (or above or below) a title, a description and optional links. Use it
for feature lists, service overviews and article teasers. It is plain markup and CSS, so it renders the same under
static SSR and in interactive modes.
Package Osirion.Blazor.Core, namespace Osirion.Blazor.Components. Source on GitHub.

@using Osirion.Blazor.Components
<OsirionFeatureCard Title="Static SSR first"
Description="Every component renders complete HTML before any script runs."
ImageUrl="/assets/images/blazor-cover.png"
ImageAlt="A browser window showing the Blazor logo, on a purple background"
ImagePosition="ImagePosition.Top"
ContentAlignment="ContentAlignment.TopLeft"
ShowReadMoreLink="true"
ReadMoreHref="/docs/getting-started" />Usage
The smallest card is a title and a description:
<OsirionFeatureCard Title="Static SSR first"
Description="Every component renders meaningful HTML before any script runs." />
A teaser that links to an article, with the image on top and category links under the text:
@using Osirion.Blazor.Components
<OsirionFeatureCard Title="Content from GitHub"
Description="Publish Markdown from a repository and refresh it with a webhook."
ImageUrl="/images/github-cms.png"
ImageAlt="Markdown files in a GitHub repository"
ImagePosition="ImagePosition.Top"
Url="/docs/components/cms-web"
ShowReadMoreLink="true"
ReadMoreText="Read the guide"
ShowPillowButtons="true"
PillowButtons="categories" />
@code {
private readonly List<PillowButton> categories =
[
new("CMS", "/blog/category/cms"),
new("Static SSR", "/blog/category/ssr", ThemeColor.Secondary)
];
}
From 4.3 a card takes a decorative Icon and a list of short Items. Without an image the card has no image
column, and its height follows its content, which suits a row of features in an
OsirionCardGrid:
<OsirionFeatureCard Title="Fast pages"
Description="HTML on the first request."
Items="@(["No client script", "Cache friendly"])">
<Icon>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" /></svg>
</Icon>
</OsirionFeatureCard>
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
Title |
string? |
null |
The card title, rendered as a paragraph with the class osirion-feature-card-title. |
Description |
string? |
null |
The text under the title. |
ShowDescription |
bool |
true |
Whether Description is shown. |
ChildContent |
RenderFragment? |
null |
Extra content between the description and the links. |
Icon |
RenderFragment? |
null |
A small decorative icon above the title, such as an svg, in a div with the class osirion-feature-card-icon and aria-hidden="true", so put no meaning in it that the title does not carry. Without an ImageUrl the card has no image column: it has a single column and its height follows its content. |
Items |
IReadOnlyList<string>? |
null |
Short phrases under the description, each behind a check mark, as an OsirionChecklist inside a div with the class osirion-feature-card-items. Empty phrases are left out. |
Url |
string? |
null |
The read more link's target when ReadMoreHref is not set, and the link around the image when the image has alternative text and the read more link does not already go to the same place. |
ImageUrl |
string? |
null |
The image source. Without it the card has no image column and is one column of text, as tall as its content. |
ImageAlt |
string? |
null |
The image's alternative text; when it is not set, Title is used, then Feature image. |
ImageLazyLoading |
bool |
true |
Whether the image renders loading="lazy". Set it to false for a card above the fold. |
ImageTransformOnHover |
bool |
false |
Whether the image zooms on hover. |
ImagePosition |
ImagePosition |
ImagePosition.Left |
Where the image sits: Top, Bottom, Left or Right. |
CardSize |
CardSize |
CardSize.Normal |
The card's dimensions, from ExtraExtraSmall to ExtraExtraLarge. |
ContentAlignment |
ContentAlignment |
ContentAlignment.CenterLeft |
Where the text sits in the card: one of nine positions, from TopLeft to BottomRight. |
ContentFontSize |
FontSizeVariant |
FontSizeVariant.Normal |
The text size, from ExtraExtraSmall to ExtraExtraLarge. |
BorderTiming |
EffectTiming |
EffectTiming.Always |
When the border shows: Never, Always or OnHover. |
BorderColor |
ThemeColor |
ThemeColor.Neutral |
The border color: Primary, Secondary, Tertiary or Neutral. |
ShadowTiming |
EffectTiming |
EffectTiming.OnHover |
When the shadow shows: Never, Always or OnHover. |
ShadowColor |
ThemeColor |
ThemeColor.Neutral |
The shadow color: Primary, Secondary, Tertiary or Neutral. |
TransformTiming |
EffectTiming |
EffectTiming.OnHover |
When the card lifts: Never, Always or OnHover. |
ShowReadMoreLink |
bool |
false |
Whether a read more link is shown; it needs ReadMoreHref or Url. |
ReadMoreText |
string |
"Read more" |
The read more link's text. |
ReadMoreHref |
string? |
null |
The read more link's target; falls back to Url. |
ReadMoreStretched |
bool |
true |
With pillow buttons shown, ends the read more link's clickable area 50 pixels above the bottom of the text, so the buttons stay clickable. |
ShowPillowButtons |
bool |
false |
Whether PillowButtons are shown. |
PillowButtons |
List<PillowButton>? |
null |
Small category-style links under the text. |
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. |
PillowButton has Text, Href (default #), Color (ThemeColor, default Primary), Target and AriaLabel,
and a constructor PillowButton(text, href, color). Unmatched attributes are passed to the card's root element.
Behavior
- No script is needed. Hover effects are CSS, and
prefers-reduced-motion: reduceturns off the lift and zoom. - The read more link is rendered with
OsirionReadMoreLinkas a stretched link: it covers the card's text area, so that whole area is one click target. The image is a separate link only whenUrlis set, the image has alternative text, and the read more link does not already go toUrl, so a card links to a place once. - The image link has no text of its own; its accessible name is the image's alternative text, so set
ImageAltto something that describes the destination. WithImageAlt=""(a decorative image) the image is not a link. - Without an
ImageUrlthe card renders no image column and no image link, and takesosirion-feature-card-without-image(orosirion-feature-card-with-iconwith anIcon) in place of the image position class. Up to 4.4.0 it drew a placeholder there, inside a link with no name whenUrlwas set. - A pillow button with neither
TextnorAriaLabelis left out, so every link has a name. - If the image fails to load, an inline
onerrorattribute swaps in a placeholder fromplacehold.co. A Content Security Policy that blocks inline event handlers, or that host inimg-src, leaves the broken image instead. - On viewports 768px wide or narrower,
LeftandRightlayouts stack into one column: the image above the content forLeft, below it forRight. - Text is HTML-encoded. URLs (
Url,ReadMoreHref,PillowButton.Href) are written as given, so pass values your application controls. Iconis wrapped in adivwitharia-hidden="true", so the title must say what the icon shows.Itemsrender as an OsirionChecklist after the description and beforeChildContent; empty phrases are left out.- A card with an image and without
IconorItemsrenders the markup it rendered before they existed.
Styling
The root element carries osirion-feature-card plus one class per setting, for example
osirion-feature-card-image-top, osirion-feature-card-md, osirion-feature-card-content-center-left,
osirion-feature-card-border-always, osirion-feature-card-shadow-hover and osirion-feature-card-transform-hover.
The card reads the theme tokens --osirion-card-background, --osirion-border-color, --osirion-action-primary,
--osirion-action-secondary and --osirion-heading-color, and --osirion-card-border-width (default 2px) for the
border, so a framework adapter or your own :root values restyle it.
The icon sits in a 3rem osirion-feature-card-icon tile in --osirion-background-tertiary, drawn in
--osirion-link-color, and an svg inside it is sized to 1.5rem. The items are wrapped in
osirion-feature-card-items.