OsirionChecklist
OsirionChecklist renders short phrases, each behind a check mark and with an optional line of description, such as
what a plan includes or what a product does. It renders a plain <ul> without script, under an optional heading that
names the list.
Package Osirion.Blazor.Core, namespace Osirion.Blazor.Components. Source on GitHub. Available from 4.3.
Included in every plan
- Static SSREvery page arrives as complete HTML.
- Light and dark themesColors come from the theme tokens.
- No client script required
@using Osirion.Blazor.Components
@using Osirion.Blazor.Core.Models
<OsirionChecklist Title="Included in every plan" Items="items" />
@code {
private static readonly ChecklistItem[] items =
[
new("Static SSR", "Every page arrives as complete HTML."),
new("Light and dark themes", "Colors come from the theme tokens."),
new("No client script required"),
];
}Usage
Items are ChecklistItem records from Osirion.Blazor.Core.Models:
@using Osirion.Blazor.Components
@using Osirion.Blazor.Core.Models
<OsirionChecklist Title="Included in every plan" Items="@items" />
@code {
private readonly ChecklistItem[] items =
[
new("Static SSR", "Every page arrives as complete HTML."),
new("Light and dark themes"),
];
}
The heading is an h3, which fits a list inside a section that has its own h2. Set HeadingLevel to keep the
outline in order elsewhere. HeroSection shows its Highlights and
OsirionFeatureCard its Items through this component.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
Title |
string? |
null |
The heading above the list, rendered at HeadingLevel; it also names the list for screen readers. With an empty value no heading is rendered. |
HeadingLevel |
int |
3 |
The level of the heading, 1 to 6 (h1 to h6). It defaults to 3, a list inside a section that has its own h2. A value outside the range is moved to the nearest level. The heading keeps its look at every level. |
Items |
IReadOnlyList<ChecklistItem> |
[] |
The items, in order. With none, only the heading is rendered. |
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 root <div>.
ChecklistItem(string Title, string? Description = null) is a record: Title is the phrase and Description an
optional line of plain text under it.
Behavior
- The component renders plain HTML and needs no script.
- The items are a
<ul>withrole="list", which keeps the list semantics that some browsers drop from a list without bullets, so screen readers announce how many items there are. - With a
Title, the list hasaria-labelledbypointing at the heading. Each instance generates the heading'sid, so two lists on a page never repeat one. - Each check mark is an inline
<svg>witharia-hidden="true"andfocusable="false": the phrase alone carries the meaning. HeadingLevelsetsh1toh6. A value outside 1 to 6 moves to the nearest level, and the heading looks the same at every level.- With no title and no items, the component renders nothing. Title, phrases and descriptions are HTML-encoded.
Styling
Classes: osirion-checklist (the root), osirion-checklist-title, osirion-checklist-list, osirion-checklist-item,
osirion-checklist-mark, osirion-checklist-text, osirion-checklist-item-title and
osirion-checklist-item-description.
The check mark is drawn in --osirion-link-color (CanvasText in forced colors mode), the phrase inherits the
text color around it and the description uses --osirion-text-secondary. The items stay left-aligned inside a
centered block.
Related
- Hero section, whose
Highlightsrender as a checklist - Feature card, whose
Itemsrender as a checklist - Steps, for numbered steps