Pass the span and one count for each bucket. Put the axis in the track and the playback buttons in the controls.
visitors-today.tsx
TimelineScrubber
<fieldset>| Prop | Type | Default | Description |
|---|---|---|---|
| aria-label | string | — | Defines a string value that labels the current element. The accessible name of the group and the playhead. Default "Time". |
| start | number | — | The start of the span (ms since 1970). |
| end | number | — | The end of the span (ms). The future after now is a dashed line. |
| now | number | — | Now (ms), from the app clock. Leave it out and the part reads Date.now once a second. |
| counts | readonly number[] | — | One count per bucket, evenly from start to end; buckets after now are not drawn. |
| default | "live""paused" | "live" | paused starts on defaultValue; live (default) starts on now. |
| default | number | — | The first head time with defaultMode="paused". |
| replay | number | 12_000 | How long a replay from start to now takes, in ms. Default 12,000. |
| step | number | — | The arrow key step in ms. Default: one bucket. |
| large | number | 60 * 60 * 1000 | The Page key step in ms. Default: one hour. |
| time | string | — | The IANA time zone of the clock and the axis. Default: the browser zone. |
| locale | LocalesArgument | — | |
| size | "default""lg""sm" | "default" | The bar area height: sm 32, default 48, lg 64px. |
| disabled | boolean | false | |
| labels | — | The words of the Play button (TIMELINE_SCRUBBER_LABELS), to translate them. Keep the object stable. | |
| on | — | ||
| on | — | The head time, on each change (a drag, a key, each replay frame, each live second). | |
| ...props | <fieldset> attributes | — | Every other attribute goes to the <fieldset>, with a ref. |
TimelineScrubberControls
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TimelineScrubberReplay
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| children | ReactNode | "Replay" | The label. Default "Replay". It hides under 384px and stays the name. | ||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| 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. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
TimelineScrubberPlay
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| 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. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
TimelineScrubberLive
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| children | ReactNode | "Go live" | The label while not live. Default "Go live". | ||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| live | ReactNode | "Live" | The label while live. Default "Live". | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| 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. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
TimelineScrubberClock
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
TimelineScrubberTrack
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What goes under the bars. Default: a TimelineScrubberAxis. Pass null for none. |
| label | string | — | The accessible name of the playhead. Default: the root aria-label. |
| get | timelineValueText | The value text of the playhead from the time ("09:07 UTC") and the count of its bar. Default: "09:07 UTC, 214 in this bar". Name what is counted: "09:07 UTC, 214 visitors". | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TimelineScrubberAxis
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ticks | number | 5 | How many ticks, start and end included. Default 5 (every 6 hours of a day). |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Arrow keys | Moves the head by one bucket, or by step. |
|---|---|
| Page UporPage Down | Moves the head by largeStep (one hour by default). |
| HomeorEnd | Moves the head to the start or to now. |
| Space | Plays or pauses, while the head has focus. |
Built with
Installs with Timeline Scrubber













