BlogPost
A post card with a cover image, a culture formatted date, a badge and authors. The title is the only link and covers the card.
On this page
Examples
Orientation and variants
Without Href the card has no link, so its content can hold links of its own.
Release
Introducing the marketing components
Pricing, changelog and blog components that read well on every screen.
Ada LovelaceMaintainer
Why a card has one link
The title carries the link and stretches over the card, so there is a single tab stop.
Razor
<div class="flex w-full flex-col gap-6">
<KlyBlogPost Title="Introducing the marketing components" Description="Pricing, changelog and blog components that read well on every screen."
Date="@(new DateTimeOffset(2026, 11, 18, 0, 0, 0, TimeSpan.Zero))" Badge="Release" Orientation="KlyOrientation.Horizontal"
Href="/docs" Image="@Cover" ImageAlt="Abstract yellow and teal gradient"
Authors="@(new[] { new KlyPostAuthor("Ada Lovelace") { Description = "Maintainer" } })" />
<KlyBlogPost Title="Why a card has one link" Description="The title carries the link and stretches over the card, so there is a single tab stop."
Date="@(new DateTimeOffset(2026, 11, 2, 0, 0, 0, TimeSpan.Zero))" Variant="BlogPostVariant.Soft" DateFormat="d MMM yyyy">
<div class="flex gap-2 text-sm">
<a href="/docs" class="text-(--klyroo-primary-text) underline underline-offset-4">Read the article</a>
<a href="/docs" class="text-(--klyroo-primary-text) underline underline-offset-4">Share</a>
</div>
</KlyBlogPost>
</div>
@code {
private static readonly string Cover = "data:image/svg+xml," + Uri.EscapeDataString(
"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 9'><defs><linearGradient id='g'><stop offset='0' stop-color='#ffd23f'/><stop offset='1' stop-color='#1f6f7a'/></linearGradient></defs><rect width='16' height='9' fill='url(#g)'/></svg>");
}API
KlyBlogPost
Card for one blog post: image, date, title, description, badge and authors, with a single link covering the card.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Authors |
IReadOnlyList |
One author shows a KlyUser , several show a KlyAvatarGroup named after them. | |
Badge |
string |
Text of a badge over the image, such as a category. | |
BadgeColor |
KlyColor |
"primary" |
Semantic color of the badge. Values: primary, secondary, success, info, warning, error, neutral. |
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Color |
KlyColor |
"primary" |
Semantic color of the blog post: a built-in KlyColor or the name of a color you defined. When not set, Color applies, else the default of the component. Values: primary, secondary, success, info, warning, error, neutral. |
Culture |
CultureInfo |
The culture of the date. By default the format culture of the locale in effect (the regional current culture when it has the same language), so the prerender and a WebAssembly render agree as long as they pick the same locale. | |
Date |
DateTimeOffset? |
Publication date, shown in the format culture of the locale in effect (the regional current culture when it has the same language), or in Culture (see DateFormat ) in a time element. | |
DateFormat |
string |
A .NET date format. Without one, the long date of the culture without the day name. | |
Description |
string |
Secondary text of the blog post, shown under or next to its title. | |
HeadingLevel |
int |
3 |
Level of the title heading: 3 by default, for a list of posts under a level 2 heading. |
Href |
string |
Makes the whole card a link to this address, through the title. | |
Image |
string |
Cover image. Decorative unless ImageAlt says what it shows. | |
ImageAlt |
string |
Alternative text of the image. Leave it empty when the image is decorative. | |
ImageOptions |
KlyImageOptions |
Image settings forwarded to KlyImage (format, quality, sizes, provider, preset…). | |
Orientation |
KlyOrientation |
KlyOrientation. |
Whether the image sits above the text ( Vertical ) or beside it ( Horizontal ). Values: Horizontal, Vertical. |
Target |
KlyLinkTarget? |
The target attribute of the link of the card, such as Blank . It applies when Href is set. | |
Title |
string |
Title of the blog post. | |
Ui |
BlogPostUi |
Per-instance class overrides of the slots of the blog post, see BlogPostUi . They are merged after the theme and the Class parameter wins on the root slot. | |
Variant |
BlogPostVariant |
BlogPostVariant. |
Look of the card: Outline , Soft , Subtle , Ghost or Naked . Values: Outline, Soft, Subtle, Ghost, Naked. |
Slots
| Name | Type | Description |
|---|---|---|
Footer |
RenderFragment |
Content at the bottom of the card, under the description. |
Header |
RenderFragment |
Replaces the cover image. |
ChildContent |
RenderFragment |
Extra content between the description and the authors. |
Ui slots
Ui takes a BlogPostUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyBlogPost , after the theme and the app configuration. |
Header |
Classes merged into the header slot of KlyBlogPost , after the theme and the app configuration. |
Image |
Classes merged into the image slot of KlyBlogPost , after the theme and the app configuration. |
Body |
Classes merged into the body slot of KlyBlogPost , after the theme and the app configuration. |
Meta |
Classes merged into the meta slot of KlyBlogPost , after the theme and the app configuration. |
Date |
Classes merged into the date slot of KlyBlogPost , after the theme and the app configuration. |
Badge |
Classes merged into the badge slot of KlyBlogPost , after the theme and the app configuration. |
Title |
Classes merged into the title slot of KlyBlogPost , after the theme and the app configuration. |
Link |
Classes merged into the link slot of KlyBlogPost , after the theme and the app configuration. |
Description |
Classes merged into the description slot of KlyBlogPost , after the theme and the app configuration. |
Authors |
Classes merged into the authors slot of KlyBlogPost , after the theme and the app configuration. |
Footer |
Classes merged into the footer slot of KlyBlogPost , after the theme and the app configuration. |