Timeline

DTimeline + DTimelineItem render daisyUI's timeline. Each item can fill the Start, Middle, End and Box slots; the connector line is a styled hr (hide it on the last item).

Vertical with icons— SnapIcon + alternating sides
  • Project started

    Repository created, scaffold committed.


  • First release

    Form components, modals and theming shipped.


  • You are here
<DTimeline Orientation="DaisyOrientation.Vertical" SnapIcon="true" Class="max-w-2xl">
    <DTimelineItem ConnectorClass="bg-[var(--color-primary)]"
                   StartClass="md:text-end mb-10"
                   MiddleClass="text-[var(--color-primary)]">
        <Middle>@(Dot("primary"))</Middle>
        <Start>
            <time class="font-bold opacity-60">2024-01-01</time>
            <div class="font-semibold">Project started</div>
            <p class="opacity-70">Repository created, scaffold committed.</p>
        </Start>
    </DTimelineItem>
    <DTimelineItem ConnectorClass="bg-[var(--color-primary)]"
                   EndClass="mb-10"
                   MiddleClass="text-[var(--color-primary)]">
        <Middle>@(Dot("primary"))</Middle>
        <End>
            <time class="font-bold opacity-60">2024-06-01</time>
            <div class="font-semibold">First release</div>
            <p class="opacity-70">Form components, modals and theming shipped.</p>
        </End>
    </DTimelineItem>
    <DTimelineItem HideConnector="true"
                   StartClass="md:text-end"
                   MiddleClass="text-[var(--color-secondary)]">
        <Middle>@(Dot("secondary"))</Middle>
        <Start>
            <time class="font-bold opacity-60">today</time>
            <div class="font-semibold">You are here</div>
        </Start>
    </DTimelineItem>
</DTimeline>
 
@code {
    private static RenderFragment Dot(string color) => builder =>
    {
        builder.OpenElement(0, "svg");
        builder.AddAttribute(1, "xmlns", "http://www.w3.org/2000/svg");
        builder.AddAttribute(2, "viewBox", "0 0 24 24");
        builder.AddAttribute(3, "fill", "currentColor");
        builder.AddAttribute(4, "class", "h-3 w-3");
        builder.AddMarkupContent(5, "<circle cx=\"12\" cy=\"12\" r=\"10\" />");
        builder.CloseElement();
    };
}
Boxes— the Box slot renders timeline-box
  • Plan
    step

  • Build
    step

  • Ship
    step

<DTimeline Orientation="DaisyOrientation.Horizontal" Class="max-h-[220px]">
    @foreach (var (label, color) in new[] { ("Plan", "primary"), ("Build", "secondary"), ("Ship", "accent") })
    {
        <DTimelineItem ConnectorClass="@($"bg-[var(--color-{color})]")"
                       HideConnector="@(color == "Ship")"
                       MiddleClass="@($"text-[var(--color-{color})]")">
            <Middle>@(Dot(color))</Middle>
            <Box>
                <div class="font-semibold">@label</div>
                <div class="text-sm opacity-70">step</div>
            </Box>
        </DTimelineItem>
    }
</DTimeline>
 
@code {
    private static RenderFragment Dot(string color) => builder =>
    {
        builder.OpenElement(0, "svg");
        builder.AddAttribute(1, "xmlns", "http://www.w3.org/2000/svg");
        builder.AddAttribute(2, "viewBox", "0 0 24 24");
        builder.AddAttribute(3, "fill", "currentColor");
        builder.AddAttribute(4, "class", "h-3 w-3");
        builder.AddMarkupContent(5, "<circle cx=\"12\" cy=\"12\" r=\"10\" />");
        builder.CloseElement();
    };
}
Compact— Compact puts everything on one side
  • Checkpoint A

  • Checkpoint B

  • Checkpoint C

<DTimeline Orientation="DaisyOrientation.Vertical" Compact="true" Class="max-w-md">
    @foreach (var label in new[] { "Checkpoint A", "Checkpoint B", "Checkpoint C" })
    {
        <DTimelineItem MiddleClass="text-[var(--color-primary)]">
            <Middle>@(Dot("primary"))</Middle>
            <End>
                <div class="font-semibold">@label</div>
            </End>
        </DTimelineItem>
    }
</DTimeline>
 
@code {
    private static RenderFragment Dot(string color) => builder =>
    {
        builder.OpenElement(0, "svg");
        builder.AddAttribute(1, "xmlns", "http://www.w3.org/2000/svg");
        builder.AddAttribute(2, "viewBox", "0 0 24 24");
        builder.AddAttribute(3, "fill", "currentColor");
        builder.AddAttribute(4, "class", "h-3 w-3");
        builder.AddMarkupContent(5, "<circle cx=\"12\" cy=\"12\" r=\"10\" />");
        builder.CloseElement();
    };
}

API

DTimeline

Parameters

Name Type Default Binding Description
Orientation DaisyOrientation Auto — Vertical ( timeline-vertical ) or Horizontal ( timeline-horizontal ); Auto lets daisyUI decide.
AutoVerticalHorizontal
Compact bool False — Puts every item on one side/row ( timeline-compact ) — useful for narrow layouts.
SnapIcon bool False — Snaps the item markers to the icon ( timeline-snap-icon ).
ChildContent RenderFragment — — The items ( DTimelineItem children).
Class string — — Additional CSS classes appended to the component's computed daisyUI classes.
Style string — — Inline styles applied to the root element.
DTimelineItem

Parameters

Name Type Default Binding Description
Start RenderFragment — — Content on the "start" side (left in vertical timelines). Give it margins like daisyUI examples.
StartClass string — — Extra classes for the start side (e.g. md:text-end mb-10 ).
Middle RenderFragment — — The marker content on the line (usually an icon or dot).
MiddleClass string — — Extra classes for the marker.
End RenderFragment — — Content on the "end" side (right in vertical timelines).
EndClass string — — Extra classes for the end side (e.g. mb-10 ).
Box RenderFragment — — Content in a bordered box on the line ( timeline-box ).
BoxClass string — — Extra classes for the box.
ConnectorClass string — — Extra classes for the connector line (e.g. a background utility class).
HideConnector bool False — Hides the connector line (e.g. for the last item).
Class string — — Additional CSS classes appended to the component's computed daisyUI classes.
Style string — — Inline styles applied to the root element.
Connection lost — reconnecting…
Connection failed.
The server has stopped.