Day Separator
Mark where a new day starts in a conversation, with a heading that reads Today or Yesterday.
Use a day separator before the first message of each day, so a long conversation shows when things were said. It's a heading, so screen reader users can jump from one day to the next.
Can you check why the nightly export failed?
Every run since last week stopped after 30 seconds waiting on the reports service.
Did last night's run go through?
Yes. It retried two pages and finished in 48 minutes.
Installation
npx shadcn@latest add @kind-ui/day-separatorComposition
DaySeparator
└── DaySeparatorLabelThe root is the heading, with a line on each side drawn in CSS. DaySeparatorLabel renders a <time> whose datetime is the day as YYYY-MM-DD, and shows the day in words unless you pass children. DaySeparator renders its label when you pass none.
Usage
Date
Pass date, an ISO date ("2026-11-18") or date-time ("2026-11-18T17:40:00Z"). timeZone decides which day a date-time falls on, and which day is today, so pass the reader's zone. It's UTC by default.
In the browser, the heading reads "Today", "Yesterday", its weekday up to 6 days back, and its date before that. Server markup always shows the date ("November 18, 2026"), and the words change once the page loads, so hydration never mismatches. A page left open past midnight moves "Today" to "Yesterday" on its own. Pass relative={false} to always show the date.
The day reads in locale, else the page's language, else English. The heading is level 3; pass level (1 to 6) to fit it into your page's outline.
Between Messages
Put a separator before each message whose day differs from the previous message's. dayKey turns a createdAt into the day it falls on in a time zone:
import { dayKey } from "@kind-ui/agent-ui/core";
{messages.map((message, index) => {
const previous = messages[index - 1];
const newDay =
!previous || dayKey(previous.createdAt, timeZone) !== dayKey(message.createdAt, timeZone);
return (
<Fragment key={message.id}>
{newDay && <DaySeparator date={message.createdAt} timeZone={timeZone} />}
<MessageView message={message} />
</Fragment>
);
})}Pass the same timeZone to dayKey and the separator, so the day you split on is the day the heading names. In a virtualized conversation, make each separator its own row, as the example does, so it's measured like any other.
API Reference
Prop
Type
Agent
A day separator is content, so it offers an agent connected with createAgent no actions.
Runs in React, Vue, Svelte, Solid and Web Components. Call defineDaySeparator(), then write <kind-day-separator date="2026-11-18" time-zone="America/Los_Angeles">: each prop is a kebab-case attribute, so timeZone is time-zone. The element fills in its label when it has no children, and leaves text you wrote into a <kind-day-separator-label> alone.