Time Stamp
Displays a formatted timestamp that can show either absolute or relative time.
Overview
- dateFormat
- absolute · relative
- textSize
- small · medium · large
- textColor
- secondary · primary
- data
- date-and-time · date · time
All options
Format and data
| dateFormat \ data | date-and-time | date | time |
|---|---|---|---|
| absolute | |||
| relative |
Text size and color
| textSize \ textColor | primary | secondary |
|---|---|---|
| large | ||
| medium | ||
| small |
Accessibility
Machine-readable time
TimeStamp renders a <time> element whose dateTime attribute holds the ISO date of createdAt, so the exact time is available even when the visible text is relative.
Props
| Prop | Type | Required | Description |
|---|---|---|---|
| createdAt | string | number | Date | Yes | — |
| dateFormat | 'absolute' | 'relative' | Yes | — |
| textSize | 'small' | 'medium' | 'large' | No | — |
| textColor | 'secondary' | 'primary' | No | — |
| data | 'date-and-time' | 'date' | 'time' | No | — |