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)
];
}
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. |
Url |
string? |
null |
The link around the image, and the read more link's target when ReadMoreHref is not set. |
ImageUrl |
string? |
null |
The image source. Without it the card shows a placeholder icon. |
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. - When
Urlis set, the image link has no text of its own; its accessible name is the image's alternative text, so setImageAltto something that describes the destination. - 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.
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.