Skip to content
Blocks DateTile

DateTile

A calendar tile.

On this page

Examples

Date, countdown and range

Pass Now for a stable server render.

RenewalAnnual plan
In 20 daysRenewal
2026-03-14 → 2026-03-16 (3 days)Conference
Razor
<div class="grid w-full gap-4 sm:grid-cols-3">
    <KlyDateTile Mode="KlyDateTileMode.Date" Value="@_renewal" Title="Renewal" Description="Annual plan" Now="@_now" Surface="KlySurface.Bordered" />
    <KlyDateTile Mode="KlyDateTileMode.Countdown" Value="@_renewal" Title="Renewal" Now="@_now" Surface="KlySurface.Bordered" />
    <KlyDateTile Mode="KlyDateTileMode.Range" Value="@_start" EndValue="@_end" Title="Conference" Now="@_now" Surface="KlySurface.Bordered" />
</div>

@code {
    private readonly DateTimeOffset _now = new(2026, 3, 12, 9, 0, 0, TimeSpan.Zero);
    private readonly DateTimeOffset _renewal = new(2026, 4, 1, 0, 0, 0, TimeSpan.Zero);
    private readonly DateTimeOffset _start = new(2026, 3, 14, 0, 0, 0, TimeSpan.Zero);
    private readonly DateTimeOffset _end = new(2026, 3, 16, 0, 0, 0, TimeSpan.Zero);
}

API

KlyDateTile

A calendar tile with a title, in a plain, countdown or range mode.

Parameters

Name Type Default Description
Class string Classes added to the root element, merged last so they win over the theme.
Description string A line of smaller text under the title.
EndValue DateTimeOffset? The end of a Range , inclusive in the day count.
Loading bool false Shows a skeleton placeholder instead of the content.
Mode KlyDateTileMode KlyDateTileMode.Date What the tile says beside the calendar: the date, the days until it, or a range. Values: Date, Countdown, Range.
Now DateTimeOffset? The reference time of a Countdown . UtcNow when not set. Pass it for tests and for stable server rendering.
Surface KlySurface? The surface treatment. Plain when not set. Values: Plain, Muted, Bordered, Elevated.
Title string The title. In the default mode it replaces the formatted date; in the countdown and range modes it is a caption under the text.
Ui DateTileUi Per-instance class overrides of the slots of the date tile, see DateTileUi . They are merged after the theme and the Class parameter wins on the root slot.
Value DateTimeOffset? The date, or the start of a range. The current date when not set.

Ui slots

Ui takes a DateTileUi with one class string per slot, merged after the theme.

Slot Styles
Root Classes merged into the root slot of KlyDateTile , after the theme and the app configuration.
Tile Classes merged into the tile slot of KlyDateTile , after the theme and the app configuration.
Month Classes merged into the month slot of KlyDateTile , after the theme and the app configuration.
Day Classes merged into the day slot of KlyDateTile , after the theme and the app configuration.
Text Classes merged into the text slot of KlyDateTile , after the theme and the app configuration.
Title Classes merged into the title slot of KlyDateTile , after the theme and the app configuration.
Caption Classes merged into the caption slot of KlyDateTile , after the theme and the app configuration.
Description Classes merged into the description slot of KlyDateTile , after the theme and the app configuration.
Skeleton Classes merged into the skeleton slot of KlyDateTile , after the theme and the app configuration.