BlogPosts
A responsive grid or a stacked list of blog posts.
On this page
Examples
Grid
One author shows a user, several show an avatar group named after them.
Engineering
Rendering the same component in four modes
How Klyroo keeps one markup for server, WebAssembly, auto and static rendering.
Ada Lovelace
Accessibility
Accessible by default
Each pattern follows the WAI-ARIA Authoring Practices and is checked with axe.
Margaret HamiltonStaff engineer
Razor
<div class="w-full">
<KlyBlogPosts>
@foreach (var post in Posts)
{
<KlyBlogPost Title="@post.Title" Description="@post.Description" Date="post.Date" Badge="@post.Badge" Href="@post.Href"
Image="@Cover(post.From, post.To)" Authors="post.Authors" />
}
</KlyBlogPosts>
</div>
@code {
private sealed record Post(string Title, string Description, DateTimeOffset Date, string Badge, string Href, string From, string To, KlyPostAuthor[] Authors);
private static readonly Post[] Posts =
[
new("Rendering the same component in four modes", "How Klyroo keeps one markup for server, WebAssembly, auto and static rendering.",
new(2026, 11, 12, 0, 0, 0, TimeSpan.Zero), "Engineering", "/docs/render-modes", "#ffd23f", "#1f6f7a", [new("Ada Lovelace")]),
new("A theme in 40 lines of CSS", "Rebrand every component by overriding a handful of tokens.",
new(2026, 10, 28, 0, 0, 0, TimeSpan.Zero), "Design", "/docs/theming", "#1f6f7a", "#0b0c0d", [new("Grace Hopper"), new("Alan Turing")]),
new("Accessible by default", "Each pattern follows the WAI-ARIA Authoring Practices and is checked with axe.",
new(2026, 10, 9, 0, 0, 0, TimeSpan.Zero), "Accessibility", "/docs", "#c0392b", "#ffd23f", [new("Margaret Hamilton") { Description = "Staff engineer" }]),
];
// A gradient drawn on the fly, so the example needs no image files.
private static string Cover(string from, string to) =>
"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='{from}'/><stop offset='1' stop-color='{to}'/></linearGradient></defs><rect width='16' height='9' fill='url(#g)'/></svg>");
}API
KlyBlogPosts
Responsive grid of KlyBlogPost cards.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Orientation |
KlyOrientation |
KlyOrientation. |
Horizontal places the posts next to each other in a responsive grid, vertical stacks them in one column. Values: Horizontal, Vertical. |
Ui |
BlogPostsUi |
Per-instance class overrides of the slots of the blog posts, see BlogPostsUi . They are merged after the theme and the Class parameter wins on the root slot. |
Slots
| Name | Type | Description |
|---|---|---|
ChildContent |
RenderFragment |
The posts, usually KlyBlogPost items. |
Ui slots
Ui takes a BlogPostsUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyBlogPosts , after the theme and the app configuration. |