Pass the length in seconds. Put a DurationEmpty inside for a step that has no time yet.
build-steps.tsx
Duration
<time>| Prop | Type | Default | Description |
|---|---|---|---|
| seconds | number | — | The length in seconds. A negative value or NaN shows as 0. With since or until, it is the value once the clock stops (live false), or the empty text. |
| duration | number | — | The length in milliseconds, in place of seconds: 2400 is "2.4s". |
| value | string | — | The length as an ISO 8601 duration, in place of seconds: "PT1H30M", "P1DT2H". Years and months have no fixed length, so "P1M" is invalid and shows empty. |
| since | DateLike | — | A live count-up: whole seconds since this time (a Date, ISO text, or epoch milliseconds) on the shared second clock (useElapsedSeconds), so only this part renders on a tick. A muted box of about the final width shows before hydration. |
| until | DateLike | — | A live count-down: whole seconds left until this time, rounded up. |
| live | boolean | true | Run the since or until clock. Default true; false shows seconds (the end value). |
| now | DateLike | — | A fixed now for since and until (tests, stories, a frozen view): no clock runs, and it shows before hydration too. |
| on | — | Called once when an until clock reaches 0 while it runs. | |
| kind | "clock""units""words" | "units" | The look of the text. Default units. |
| length | "long""narrow""short" | "long" | The words of kind="words": long (default) "1 minute, 8 seconds", short "1 min, 8 sec", narrow "1m 8s". |
| fraction | "auto"01 | "auto" | The fraction digits of units. Default auto: one digit under 10s ("2.4s"), none from 10s on ("14s"). A live clock always shows whole seconds, so it ticks "1s", "2s", "3s". |
| animated | boolean | true | Roll the digits that change on the Rolling Number (units and clock). Default true. false prints plain text: for long lists and table cells. Words never roll. |
| locale | string | — | The BCP 47 locale ("de-DE"). Default: the DisplayLocaleProvider locale, else "en-US". |
| children | ReactNode | — | DurationEmpty, the words of no value, and DurationEnded, what shows in place of the time when an until clock is at 0 ("Done", "Expired"). Only the one for the current state draws. |
| ...props | <time> attributes | — | Every other attribute goes to the <time>, with a ref. |
DurationEmpty
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| data-slot | string | — | The data-slot of the root: the item's own slot ("time-ago"). Default "empty-value". |
From Base UIUseRenderBase UI docs | |||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DurationEnded
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
Built with
Installs with Duration
- Components
- Rolling Number





