Marker: Relative dates
<MarkerTime /> renders a <time> that reads Today, Yesterday, a weekday within the last week, then a short date. It updates itself at midnight. Pass format for your own wording.
This adds the example as components/examples/marker/time.tsx, together with the Marker component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/marker-time.jsonTo add only the component, follow the Marker installation.
Props in this example
The Marker props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "separator" | "border" | "default" |
| Prop | Type | Default |
|---|---|---|
dateRequired. Anything new Date() accepts. | Date | string | number | – |
formatReplace the relative label with your own. | (date: Date) => ReactNode | – |
Every prop is in the Marker API reference.
See them all, with keyboard support and accessibility notes, on the Marker page.
- AttachmentFile and image cards for uploads, with progress, states, actions, a full-card trigger and names that keep their extension.
- BubbleChat message bubbles with variants, grouped corners, reactions and room for interactive content.
- MessageA chat message row with an avatar, name, bubbles and status, where new messages rise in from the sender's side.
- Message scrollerA chat scroll area that follows new messages, keeps your place while you read back, and counts what you missed on the jump button.