@ui-sdk/react 0.0.0-stage → 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +10 -2
  3. package/dist/accordion.d.ts +331 -0
  4. package/dist/accordion.js +25 -0
  5. package/dist/agent.d.ts +2 -0
  6. package/dist/agent.js +8 -0
  7. package/dist/alert-dialog.d.ts +56 -0
  8. package/dist/alert-dialog.js +45 -0
  9. package/dist/async-options.d.ts +22 -0
  10. package/dist/async-options.js +56 -0
  11. package/dist/autocomplete.d.ts +102 -0
  12. package/dist/autocomplete.js +195 -0
  13. package/dist/avatar.d.ts +301 -0
  14. package/dist/avatar.js +17 -0
  15. package/dist/button.d.ts +21 -0
  16. package/dist/button.js +45 -0
  17. package/dist/calendar-context.d.ts +10 -0
  18. package/dist/calendar-context.js +9 -0
  19. package/dist/calendar.d.ts +80 -0
  20. package/dist/calendar.js +257 -0
  21. package/dist/carousel.d.ts +52 -0
  22. package/dist/carousel.js +151 -0
  23. package/dist/checkbox.d.ts +24 -0
  24. package/dist/checkbox.js +98 -0
  25. package/dist/children.d.ts +38 -0
  26. package/dist/children.js +63 -0
  27. package/dist/collapsible.d.ts +302 -0
  28. package/dist/collapsible.js +19 -0
  29. package/dist/color-picker.d.ts +72 -0
  30. package/dist/color-picker.js +133 -0
  31. package/dist/color.d.ts +2 -0
  32. package/dist/color.js +22 -0
  33. package/dist/combobox.d.ts +152 -0
  34. package/dist/combobox.js +338 -0
  35. package/dist/command.d.ts +88 -0
  36. package/dist/command.js +233 -0
  37. package/dist/controller-target.d.ts +3 -0
  38. package/dist/controller-target.js +59 -0
  39. package/dist/date-input.d.ts +19 -0
  40. package/dist/date-input.js +58 -0
  41. package/dist/date-picker.d.ts +47 -0
  42. package/dist/date-picker.js +310 -0
  43. package/dist/date.d.ts +2 -0
  44. package/dist/date.js +60 -0
  45. package/dist/dialog-parts.d.ts +23 -0
  46. package/dist/dialog-parts.js +142 -0
  47. package/dist/dialog.d.ts +57 -0
  48. package/dist/dialog.js +32 -0
  49. package/dist/drawer.d.ts +70 -0
  50. package/dist/drawer.js +158 -0
  51. package/dist/editor-context.d.ts +4 -0
  52. package/dist/editor-context.js +9 -0
  53. package/dist/field-context.d.ts +47 -0
  54. package/dist/field-context.js +87 -0
  55. package/dist/field.d.ts +49 -0
  56. package/dist/field.js +169 -0
  57. package/dist/file-input.d.ts +46 -0
  58. package/dist/file-input.js +170 -0
  59. package/dist/form-inputs.d.ts +5 -0
  60. package/dist/form-inputs.js +22 -0
  61. package/dist/gesture.d.ts +1 -0
  62. package/dist/gesture.js +16 -0
  63. package/dist/history.d.ts +2 -0
  64. package/dist/history.js +12 -0
  65. package/dist/hover-card.d.ts +33 -0
  66. package/dist/hover-card.js +84 -0
  67. package/dist/image-cropper.d.ts +333 -0
  68. package/dist/image-cropper.js +37 -0
  69. package/dist/image.d.ts +2 -0
  70. package/dist/image.js +6 -0
  71. package/dist/input.d.ts +22 -0
  72. package/dist/input.js +51 -0
  73. package/dist/label.d.ts +294 -0
  74. package/dist/label.js +9 -0
  75. package/dist/list-items.d.ts +15 -0
  76. package/dist/list-items.js +39 -0
  77. package/dist/list-text.d.ts +4 -0
  78. package/dist/list-text.js +15 -0
  79. package/dist/listbox.d.ts +56 -0
  80. package/dist/listbox.js +122 -0
  81. package/dist/menu.d.ts +116 -0
  82. package/dist/menu.js +426 -0
  83. package/dist/menubar-context.d.ts +4 -0
  84. package/dist/menubar-context.js +7 -0
  85. package/dist/menubar.d.ts +11 -0
  86. package/dist/menubar.js +32 -0
  87. package/dist/meter.d.ts +312 -0
  88. package/dist/meter.js +30 -0
  89. package/dist/navigation-menu.d.ts +61 -0
  90. package/dist/navigation-menu.js +169 -0
  91. package/dist/number-input.d.ts +44 -0
  92. package/dist/number-input.js +185 -0
  93. package/dist/number.d.ts +2 -0
  94. package/dist/number.js +40 -0
  95. package/dist/observe.d.ts +2 -0
  96. package/dist/observe.js +8 -0
  97. package/dist/otp-input.d.ts +29 -0
  98. package/dist/otp-input.js +94 -0
  99. package/dist/overlays.d.ts +26 -0
  100. package/dist/overlays.js +82 -0
  101. package/dist/pagination.d.ts +336 -0
  102. package/dist/pagination.js +71 -0
  103. package/dist/password-input.d.ts +23 -0
  104. package/dist/password-input.js +65 -0
  105. package/dist/popover.d.ts +54 -0
  106. package/dist/popover.js +151 -0
  107. package/dist/popup.d.ts +41 -0
  108. package/dist/popup.js +180 -0
  109. package/dist/preferences.d.ts +35 -0
  110. package/dist/preferences.js +93 -0
  111. package/dist/primitive.d.ts +2 -0
  112. package/dist/primitive.js +14 -0
  113. package/dist/progress.d.ts +312 -0
  114. package/dist/progress.js +30 -0
  115. package/dist/radio.d.ts +22 -0
  116. package/dist/radio.js +86 -0
  117. package/dist/rating.d.ts +20 -0
  118. package/dist/rating.js +94 -0
  119. package/dist/render-element.d.ts +35 -0
  120. package/dist/render-element.js +103 -0
  121. package/dist/resizable.d.ts +302 -0
  122. package/dist/resizable.js +23 -0
  123. package/dist/scroll-area.d.ts +324 -0
  124. package/dist/scroll-area.js +49 -0
  125. package/dist/segmented-control.d.ts +24 -0
  126. package/dist/segmented-control.js +78 -0
  127. package/dist/segmented-input.d.ts +15 -0
  128. package/dist/segmented-input.js +48 -0
  129. package/dist/select.d.ts +125 -0
  130. package/dist/select.js +330 -0
  131. package/dist/separator.d.ts +290 -0
  132. package/dist/separator.js +9 -0
  133. package/dist/shortcuts.d.ts +32 -0
  134. package/dist/shortcuts.js +61 -0
  135. package/dist/slider.d.ts +38 -0
  136. package/dist/slider.js +163 -0
  137. package/dist/switch.d.ts +15 -0
  138. package/dist/switch.js +39 -0
  139. package/dist/tabs.d.ts +331 -0
  140. package/dist/tabs.js +28 -0
  141. package/dist/text-control.d.ts +22 -0
  142. package/dist/text-control.js +24 -0
  143. package/dist/text-match.d.ts +2 -0
  144. package/dist/text-match.js +8 -0
  145. package/dist/textarea.d.ts +10 -0
  146. package/dist/textarea.js +48 -0
  147. package/dist/time-input.d.ts +19 -0
  148. package/dist/time-input.js +63 -0
  149. package/dist/timeline.d.ts +327 -0
  150. package/dist/timeline.js +31 -0
  151. package/dist/toast-parts.d.ts +63 -0
  152. package/dist/toast-parts.js +144 -0
  153. package/dist/toast.d.ts +2 -0
  154. package/dist/toast.js +22 -0
  155. package/dist/toggle.d.ts +23 -0
  156. package/dist/toggle.js +76 -0
  157. package/dist/token-input.d.ts +35 -0
  158. package/dist/token-input.js +100 -0
  159. package/dist/toolbar-context.d.ts +6 -0
  160. package/dist/toolbar-context.js +16 -0
  161. package/dist/toolbar.d.ts +38 -0
  162. package/dist/toolbar.js +63 -0
  163. package/dist/tooltip.d.ts +39 -0
  164. package/dist/tooltip.js +108 -0
  165. package/dist/tree.d.ts +51 -0
  166. package/dist/tree.js +150 -0
  167. package/dist/trigger-menu.d.ts +83 -0
  168. package/dist/trigger-menu.js +167 -0
  169. package/dist/use-primitive.d.ts +178 -0
  170. package/dist/use-primitive.js +674 -0
  171. package/dist/waterfall.d.ts +80 -0
  172. package/dist/waterfall.js +108 -0
  173. package/docs/README.md +89 -0
  174. package/docs/agents.md +1523 -0
  175. package/docs/components/accordion.md +1391 -0
  176. package/docs/components/alert-dialog.md +850 -0
  177. package/docs/components/autocomplete.md +1963 -0
  178. package/docs/components/avatar.md +252 -0
  179. package/docs/components/button.md +444 -0
  180. package/docs/components/calendar.md +1687 -0
  181. package/docs/components/carousel.md +1244 -0
  182. package/docs/components/checkbox.md +1069 -0
  183. package/docs/components/collapsible.md +567 -0
  184. package/docs/components/color-picker.md +736 -0
  185. package/docs/components/combobox.md +3647 -0
  186. package/docs/components/command.md +1573 -0
  187. package/docs/components/date-input.md +608 -0
  188. package/docs/components/date-picker.md +1266 -0
  189. package/docs/components/dialog.md +1469 -0
  190. package/docs/components/drawer.md +1197 -0
  191. package/docs/components/field.md +549 -0
  192. package/docs/components/file-input.md +609 -0
  193. package/docs/components/hover-card.md +514 -0
  194. package/docs/components/image-cropper.md +579 -0
  195. package/docs/components/input.md +301 -0
  196. package/docs/components/label.md +217 -0
  197. package/docs/components/listbox.md +1130 -0
  198. package/docs/components/menu.md +1286 -0
  199. package/docs/components/menubar.md +455 -0
  200. package/docs/components/meter.md +304 -0
  201. package/docs/components/navigation-menu.md +1581 -0
  202. package/docs/components/number-input.md +1086 -0
  203. package/docs/components/otp-input.md +565 -0
  204. package/docs/components/pagination.md +648 -0
  205. package/docs/components/password-input.md +737 -0
  206. package/docs/components/popover.md +1552 -0
  207. package/docs/components/preferences.md +220 -0
  208. package/docs/components/progress.md +443 -0
  209. package/docs/components/radio.md +846 -0
  210. package/docs/components/rating.md +458 -0
  211. package/docs/components/resizable.md +982 -0
  212. package/docs/components/scroll-area.md +980 -0
  213. package/docs/components/segmented-control.md +465 -0
  214. package/docs/components/select.md +2133 -0
  215. package/docs/components/separator.md +243 -0
  216. package/docs/components/slider.md +1169 -0
  217. package/docs/components/switch.md +613 -0
  218. package/docs/components/tabs.md +1014 -0
  219. package/docs/components/textarea.md +318 -0
  220. package/docs/components/time-input.md +231 -0
  221. package/docs/components/timeline.md +677 -0
  222. package/docs/components/toast.md +1395 -0
  223. package/docs/components/toggle.md +541 -0
  224. package/docs/components/token-input.md +1007 -0
  225. package/docs/components/toolbar.md +787 -0
  226. package/docs/components/tooltip.md +884 -0
  227. package/docs/components/tree.md +1346 -0
  228. package/docs/components/trigger-menu.md +1257 -0
  229. package/docs/components/waterfall.md +754 -0
  230. package/docs/controllers.md +89 -0
  231. package/docs/core.md +8027 -0
  232. package/docs/custom-parts.md +120 -0
  233. package/docs/first-component.md +83 -0
  234. package/docs/forms.md +148 -0
  235. package/docs/hooks/async-options.md +366 -0
  236. package/docs/hooks/shortcuts.md +221 -0
  237. package/docs/installation.md +45 -0
  238. package/docs/introduction.md +32 -0
  239. package/docs/lists-and-menus.md +170 -0
  240. package/docs/llms.txt +1844 -0
  241. package/docs/parts-and-composition.md +93 -0
  242. package/docs/popups.md +117 -0
  243. package/docs/rendering.md +121 -0
  244. package/docs/server-rendering.md +253 -0
  245. package/docs/state-and-events.md +105 -0
  246. package/docs/styling-and-animation.md +176 -0
  247. package/package.json +333 -3
@@ -0,0 +1,677 @@
1
+ # Timeline
2
+
3
+ Show dated events in order, like an activity feed, a changelog or an order's progress, with arrow keys between them.
4
+
5
+ Use a Timeline for a list of things that happened, or will: a project's activity, an order's status history, a release's milestones. It's a list for screen readers, with one tab stop for keyboards, and the arrow keys move between events.
6
+
7
+ ```tsx title="demo.tsx"
8
+ "use client"
9
+
10
+ import {
11
+ Timeline,
12
+ TimelineConnector,
13
+ TimelineDescription,
14
+ TimelineItem,
15
+ TimelineMarker,
16
+ TimelineTime,
17
+ TimelineTitle,
18
+ } from "@ui-sdk/react/timeline"
19
+
20
+ const events = [
21
+ {
22
+ title: "Deployed to production",
23
+ dateTime: "2026-11-10T14:32",
24
+ time: "Today, 2:32 PM",
25
+ description: "Version 2.4.1 is live in every region.",
26
+ },
27
+ {
28
+ title: "Checks passed",
29
+ dateTime: "2026-11-10T14:20",
30
+ time: "Today, 2:20 PM",
31
+ description: "312 tests and the bundle size budget.",
32
+ },
33
+ {
34
+ title: "Pull request merged",
35
+ dateTime: "2026-11-10T13:58",
36
+ time: "Today, 1:58 PM",
37
+ description: "Ada merged Cache search results into main.",
38
+ },
39
+ {
40
+ title: "Review requested",
41
+ dateTime: "2026-11-09T17:05",
42
+ time: "Yesterday, 5:05 PM",
43
+ description: "Grace and Linus were asked to review.",
44
+ },
45
+ ]
46
+
47
+ function Example() {
48
+ return (
49
+ <Timeline aria-label="Activity">
50
+ {events.map((event) => (
51
+ <TimelineItem key={event.title}>
52
+ <TimelineMarker />
53
+ <TimelineConnector />
54
+ <TimelineTitle>{event.title}</TimelineTitle>
55
+ <TimelineTime dateTime={event.dateTime}>{event.time}</TimelineTime>
56
+ <TimelineDescription>{event.description}</TimelineDescription>
57
+ </TimelineItem>
58
+ ))}
59
+ </Timeline>
60
+ )
61
+ }
62
+
63
+ export { Example }
64
+ ```
65
+
66
+ Tab into the activity, then use Up and Down to move between events. Home and End jump to the first and last.
67
+
68
+ ## Installation
69
+
70
+ ```bash
71
+ npm install @ui-sdk/react @ui-sdk/core
72
+ ```
73
+
74
+ ## Composition
75
+
76
+ Use the following composition to build a `Timeline`:
77
+
78
+ ```text
79
+ Timeline
80
+ ├── TimelineItem
81
+ │ ├── TimelineMarker
82
+ │ ├── TimelineConnector
83
+ │ ├── TimelineTitle
84
+ │ ├── TimelineTime
85
+ │ └── TimelineDescription
86
+ └── TimelineItem
87
+ ```
88
+
89
+ Every part inside an item is optional. `TimelineMarker` is the dot or icon on the line, and `TimelineConnector` the line to the next event. Both are hidden from screen readers, so they're only for looks.
90
+
91
+ ## Usage
92
+
93
+ Import the parts and put them together:
94
+
95
+ ```tsx
96
+ import {
97
+ Timeline,
98
+ TimelineConnector,
99
+ TimelineDescription,
100
+ TimelineItem,
101
+ TimelineMarker,
102
+ TimelineTime,
103
+ TimelineTitle,
104
+ } from "@ui-sdk/react/timeline"
105
+
106
+ function Example() {
107
+ return (
108
+ <Timeline aria-label="Activity">
109
+ <TimelineItem>
110
+ <TimelineMarker />
111
+ <TimelineConnector />
112
+ <TimelineTitle>Deployed to production</TimelineTitle>
113
+ <TimelineTime dateTime="2026-11-10T14:32">2:32 PM</TimelineTime>
114
+ <TimelineDescription>Version 2.4.1 is live.</TimelineDescription>
115
+ </TimelineItem>
116
+ </Timeline>
117
+ )
118
+ }
119
+
120
+ export { Example }
121
+ ```
122
+
123
+ `Timeline` renders a `<div>` with the `list` role and each item a `<div>` with the `listitem` role. With `feed`, the same markup becomes a feed of articles. Pass `dateTime` to `TimelineTime`, so the date is machine readable while the text stays friendly.
124
+
125
+ When focus lands on an event, screen readers read its title as its name, then its time and description. Links and buttons inside an event stay in the tab order: Tab moves from the event to them, and arrow keys pressed on them stay with them.
126
+
127
+ ## Horizontal
128
+
129
+ Set `orientation="horizontal"` for a row, like a roadmap. Left and Right move between events instead of Up and Down, and they swap in right-to-left text. Set `loop={false}` to stop at either end.
130
+
131
+ ```tsx title="horizontal.tsx"
132
+ "use client"
133
+
134
+ import {
135
+ Timeline,
136
+ TimelineConnector,
137
+ TimelineItem,
138
+ TimelineMarker,
139
+ TimelineTime,
140
+ TimelineTitle,
141
+ } from "@ui-sdk/react/timeline"
142
+
143
+ const milestones = [
144
+ { title: "Kickoff", dateTime: "2026-01", time: "January" },
145
+ { title: "Design review", dateTime: "2026-03", time: "March" },
146
+ { title: "Beta", dateTime: "2026-06", time: "June" },
147
+ { title: "Launch", dateTime: "2026-09", time: "September" },
148
+ ]
149
+
150
+ function Example() {
151
+ return (
152
+ <Timeline orientation="horizontal" loop={false} aria-label="Roadmap">
153
+ {milestones.map((milestone) => (
154
+ <TimelineItem key={milestone.title}>
155
+ <TimelineMarker />
156
+ <TimelineConnector />
157
+ <TimelineTitle>{milestone.title}</TimelineTitle>
158
+ <TimelineTime dateTime={milestone.dateTime}>
159
+ {milestone.time}
160
+ </TimelineTime>
161
+ </TimelineItem>
162
+ ))}
163
+ </Timeline>
164
+ )
165
+ }
166
+
167
+ export { Example }
168
+ ```
169
+
170
+ Tab into the roadmap and press Right to reach Launch. Right again stays there.
171
+
172
+ ## Status
173
+
174
+ Give each item a `status` of `"complete"`, `"current"` or `"upcoming"` for a process, like an order's progress. The current event gets `aria-current="step"`, and Tab lands on it first. Every part of an event shows its status with `data-complete`, `data-current` or `data-upcoming`.
175
+
176
+ Create a controller with `createTimelineController` and call its `focus()` with an item's `value` to move focus to it from anywhere.
177
+
178
+ ```tsx title="status.tsx"
179
+ "use client"
180
+
181
+ import {
182
+ Timeline,
183
+ TimelineConnector,
184
+ TimelineDescription,
185
+ TimelineItem,
186
+ TimelineMarker,
187
+ TimelineTime,
188
+ TimelineTitle,
189
+ createTimelineController,
190
+ type TimelineStatus,
191
+ } from "@ui-sdk/react/timeline"
192
+ import { CheckIcon } from "lucide-react"
193
+ import * as React from "react"
194
+
195
+ const steps: {
196
+ value: string
197
+ title: string
198
+ dateTime: string
199
+ time: string
200
+ description: string
201
+ status: TimelineStatus
202
+ }[] = [
203
+ {
204
+ value: "placed",
205
+ title: "Order placed",
206
+ dateTime: "2026-11-01",
207
+ time: "Nov 1",
208
+ description: "We received your order.",
209
+ status: "complete",
210
+ },
211
+ {
212
+ value: "packed",
213
+ title: "Packed",
214
+ dateTime: "2026-11-02",
215
+ time: "Nov 2",
216
+ description: "Your items left the shelf.",
217
+ status: "complete",
218
+ },
219
+ {
220
+ value: "shipped",
221
+ title: "Shipped",
222
+ dateTime: "2026-11-03",
223
+ time: "Nov 3",
224
+ description: "On its way with the carrier.",
225
+ status: "current",
226
+ },
227
+ {
228
+ value: "delivered",
229
+ title: "Delivered",
230
+ dateTime: "2026-11-05",
231
+ time: "Nov 5",
232
+ description: "Expected by Thursday.",
233
+ status: "upcoming",
234
+ },
235
+ ]
236
+
237
+ function Example() {
238
+ const [controller] = React.useState(() => createTimelineController())
239
+ return (
240
+ <div data-slot="stack">
241
+ <div data-slot="controls">
242
+ <button onClick={() => controller.focus("shipped")}>
243
+ Go to Current Step
244
+ </button>
245
+ </div>
246
+ <Timeline aria-label="Order status" controller={controller}>
247
+ {steps.map((step) => (
248
+ <TimelineItem key={step.value} value={step.value} status={step.status}>
249
+ <TimelineMarker>
250
+ {step.status === "complete" && <CheckIcon aria-hidden="true" />}
251
+ </TimelineMarker>
252
+ <TimelineConnector />
253
+ <TimelineTitle>{step.title}</TimelineTitle>
254
+ <TimelineTime dateTime={step.dateTime}>{step.time}</TimelineTime>
255
+ <TimelineDescription>{step.description}</TimelineDescription>
256
+ </TimelineItem>
257
+ ))}
258
+ </Timeline>
259
+ </div>
260
+ )
261
+ }
262
+
263
+ export { Example }
264
+ ```
265
+
266
+ Tab into the order status. Focus starts on Shipped, the current step. Move away, then choose Go to Current Step.
267
+
268
+ A marker shows status only to sighted people. When the status matters, say it in the title or description too, like "Shipped, in progress".
269
+
270
+ ## Details
271
+
272
+ Put a [Collapsible](./collapsible.md) inside an item for details that can open. Its trigger is a button inside the event, so Tab reaches it after the event, and arrow keys still move between events.
273
+
274
+ ```tsx title="details.tsx"
275
+ "use client"
276
+
277
+ import {
278
+ Timeline,
279
+ TimelineConnector,
280
+ TimelineDescription,
281
+ TimelineItem,
282
+ TimelineMarker,
283
+ TimelineTime,
284
+ TimelineTitle,
285
+ } from "@ui-sdk/react/timeline"
286
+ import {
287
+ Collapsible,
288
+ CollapsiblePanel,
289
+ CollapsibleTrigger,
290
+ } from "@ui-sdk/react/collapsible"
291
+ import { ChevronDownIcon } from "lucide-react"
292
+
293
+ const releases = [
294
+ {
295
+ title: "Version 2.4",
296
+ dateTime: "2026-10-28",
297
+ time: "October 28",
298
+ description: "Faster search and resumable uploads.",
299
+ changes: [
300
+ "Search now matches file contents, not only names.",
301
+ "Uploads resume after the connection drops.",
302
+ ],
303
+ },
304
+ {
305
+ title: "Version 2.3",
306
+ dateTime: "2026-09-30",
307
+ time: "September 30",
308
+ description: "Shared links and a new sidebar.",
309
+ changes: [
310
+ "Shared links remember the folder they were opened from.",
311
+ "The sidebar collapses to icons on narrow screens.",
312
+ ],
313
+ },
314
+ {
315
+ title: "Version 2.2",
316
+ dateTime: "2026-08-26",
317
+ time: "August 26",
318
+ description: "Dark mode follows your system.",
319
+ changes: ["Dark mode follows the system setting.", "Avatars are sharper."],
320
+ },
321
+ ]
322
+
323
+ function Example() {
324
+ return (
325
+ <Timeline aria-label="Changelog">
326
+ {releases.map((release) => (
327
+ <TimelineItem key={release.title}>
328
+ <TimelineMarker />
329
+ <TimelineConnector />
330
+ <TimelineTitle>{release.title}</TimelineTitle>
331
+ <TimelineTime dateTime={release.dateTime}>
332
+ {release.time}
333
+ </TimelineTime>
334
+ <TimelineDescription>{release.description}</TimelineDescription>
335
+ <Collapsible>
336
+ <CollapsibleTrigger>
337
+ What Changed
338
+ <ChevronDownIcon aria-hidden="true" />
339
+ </CollapsibleTrigger>
340
+ <CollapsiblePanel>
341
+ <ul>
342
+ {release.changes.map((change) => (
343
+ <li key={change}>{change}</li>
344
+ ))}
345
+ </ul>
346
+ </CollapsiblePanel>
347
+ </Collapsible>
348
+ </TimelineItem>
349
+ ))}
350
+ </Timeline>
351
+ )
352
+ }
353
+
354
+ export { Example }
355
+ ```
356
+
357
+ Tab to What Changed under Version 2.4 and press Enter. Shift+Tab back to the event, then press Down for Version 2.3.
358
+
359
+ ## Feed
360
+
361
+ Set `feed` for a timeline that loads more as people scroll, like a social feed. It follows the [WAI-ARIA feed pattern](https://www.w3.org/WAI/ARIA/apg/patterns/feed/): the root becomes a `feed` and each item an `article` with its position and the count, and Page Down and Page Up move between articles from anywhere inside one.
362
+
363
+ Set `busy` while you load or change articles. It sets `aria-busy`, so screen readers wait for the new articles before reading on.
364
+
365
+ ```tsx title="feed.tsx"
366
+ "use client"
367
+
368
+ import {
369
+ Timeline,
370
+ TimelineConnector,
371
+ TimelineDescription,
372
+ TimelineItem,
373
+ TimelineMarker,
374
+ TimelineTime,
375
+ TimelineTitle,
376
+ } from "@ui-sdk/react/timeline"
377
+ import * as React from "react"
378
+ import { useLog } from "./log"
379
+
380
+ const updates = [
381
+ {
382
+ id: 1,
383
+ author: "Ada",
384
+ date: "2026-11-10",
385
+ time: "Nov 10",
386
+ text: "Shipped the new onboarding flow.",
387
+ },
388
+ {
389
+ id: 2,
390
+ author: "Grace",
391
+ date: "2026-11-10",
392
+ time: "Nov 10",
393
+ text: "Fixed the flaky upload test.",
394
+ },
395
+ {
396
+ id: 3,
397
+ author: "Linus",
398
+ date: "2026-11-09",
399
+ time: "Nov 9",
400
+ text: "Moved the docs to the new theme.",
401
+ },
402
+ {
403
+ id: 4,
404
+ author: "Margaret",
405
+ date: "2026-11-09",
406
+ time: "Nov 9",
407
+ text: "Wrote the launch checklist.",
408
+ },
409
+ {
410
+ id: 5,
411
+ author: "Ada",
412
+ date: "2026-11-08",
413
+ time: "Nov 8",
414
+ text: "Cut search latency in half.",
415
+ },
416
+ {
417
+ id: 6,
418
+ author: "Grace",
419
+ date: "2026-11-07",
420
+ time: "Nov 7",
421
+ text: "Added keyboard shortcuts to the editor.",
422
+ },
423
+ {
424
+ id: 7,
425
+ author: "Linus",
426
+ date: "2026-11-06",
427
+ time: "Nov 6",
428
+ text: "Cleaned up the old billing code.",
429
+ },
430
+ {
431
+ id: 8,
432
+ author: "Margaret",
433
+ date: "2026-11-05",
434
+ time: "Nov 5",
435
+ text: "Ran the accessibility review.",
436
+ },
437
+ {
438
+ id: 9,
439
+ author: "Ada",
440
+ date: "2026-11-04",
441
+ time: "Nov 4",
442
+ text: "Started the mobile layout.",
443
+ },
444
+ ]
445
+
446
+ const pageSize = 3
447
+
448
+ function Example() {
449
+ const log = useLog()
450
+ const [count, setCount] = React.useState(pageSize)
451
+ const [busy, setBusy] = React.useState(false)
452
+
453
+ function loadMore() {
454
+ setBusy(true)
455
+ setTimeout(() => {
456
+ setCount((count) => count + pageSize)
457
+ setBusy(false)
458
+ log(`Loaded ${pageSize} more updates`)
459
+ }, 600)
460
+ }
461
+
462
+ return (
463
+ <div data-slot="stack">
464
+ <div data-slot="controls">
465
+ <button disabled={busy || count >= updates.length} onClick={loadMore}>
466
+ {busy ? "Loading…" : "Load More"}
467
+ </button>
468
+ </div>
469
+ <Timeline feed busy={busy} aria-label="Team updates">
470
+ {updates.slice(0, count).map((update) => (
471
+ <TimelineItem key={update.id}>
472
+ <TimelineMarker />
473
+ <TimelineConnector />
474
+ <TimelineTitle>{update.author}</TimelineTitle>
475
+ <TimelineTime dateTime={update.date}>{update.time}</TimelineTime>
476
+ <TimelineDescription>{update.text}</TimelineDescription>
477
+ </TimelineItem>
478
+ ))}
479
+ </Timeline>
480
+ </div>
481
+ )
482
+ }
483
+
484
+ export { Example }
485
+ ```
486
+
487
+ Tab into the updates and press Page Down. Choose Load More: the feed is busy until three more updates arrive. The console logs each load.
488
+
489
+ Use a list for most timelines. A feed is for long lists that grow, where a screen reader's reading mode should flow from one article to the next.
490
+
491
+ ## Custom Rendering
492
+
493
+ Render any part as another element with `render`, like a title as a heading so people can move between events by heading:
494
+
495
+ ```tsx
496
+ <TimelineTitle render={<h3 />}>Deployed to production</TimelineTitle>
497
+ ```
498
+
499
+ [Parts and Composition](../parts-and-composition.md) explains the rendering contract.
500
+
501
+ ## Styling
502
+
503
+ The parts have no styles. Lay an item out as a grid, with the marker in its own column and the connector positioned along it. `data-orientation` on every part says which way the events run.
504
+
505
+ Use `data-first` and `data-last` on items to hide the connector after the last event. They're written once the events are in the page; for markup rendered on the server, `:last-child` does the same before it hydrates.
506
+
507
+ Each part has a `data-slot`, such as `timeline-marker`, and its state attributes are listed under [Data Attributes](#data-attributes).
508
+
509
+ `Timeline` writes `--timeline-count`, how many events it holds, and each `TimelineItem` writes `--timeline-index`, its place from 0. Use them for a horizontal row's grid columns, or to stagger an animation.
510
+
511
+ ### Timeline
512
+ - `--timeline-count`: How many events are in the page. Size a horizontal grid's columns with it.
513
+
514
+ ### TimelineItem
515
+ - `--timeline-index`: The event's place among the events in the page, 0 for the first. It follows them as they move.
516
+
517
+ ## Data Attributes
518
+
519
+ ### Timeline
520
+ `[data-slot="timeline"]`
521
+
522
+ - `data-orientation` (`horizontal`, `vertical`): Which way the events run.
523
+ - `data-busy`: Present while a feed is loading or changing events, with `busy`.
524
+
525
+ ### TimelineItem
526
+ `[data-slot="timeline-item"]`
527
+
528
+ - `data-complete`: Present when the event's status is `complete`.
529
+ - `data-orientation` (`horizontal`, `vertical`): Which way the events run.
530
+ - `data-current`: Present when the event's status is `current`.
531
+ - `data-upcoming`: Present when the event's status is `upcoming`.
532
+ - `data-first`: Present on the first event. Written once it's in the page.
533
+ - `data-last`: Present on the last event. Written once it's in the page.
534
+
535
+ ### TimelineMarker
536
+ `[data-slot="timeline-marker"]`
537
+
538
+ - `data-complete`: Present when the event's status is `complete`.
539
+ - `data-orientation` (`horizontal`, `vertical`): Which way the events run.
540
+ - `data-current`: Present when the event's status is `current`.
541
+ - `data-upcoming`: Present when the event's status is `upcoming`.
542
+
543
+ ### TimelineConnector
544
+ `[data-slot="timeline-connector"]`
545
+
546
+ - `data-complete`: Present when the event's status is `complete`.
547
+ - `data-orientation` (`horizontal`, `vertical`): Which way the events run.
548
+ - `data-current`: Present when the event's status is `current`.
549
+ - `data-upcoming`: Present when the event's status is `upcoming`.
550
+
551
+ ### TimelineTime
552
+ `[data-slot="timeline-time"]`
553
+
554
+ - `data-complete`: Present when the event's status is `complete`.
555
+ - `data-orientation` (`horizontal`, `vertical`): Which way the events run.
556
+ - `data-current`: Present when the event's status is `current`.
557
+ - `data-upcoming`: Present when the event's status is `upcoming`.
558
+
559
+ ### TimelineTitle
560
+ `[data-slot="timeline-title"]`
561
+
562
+ - `data-complete`: Present when the event's status is `complete`.
563
+ - `data-orientation` (`horizontal`, `vertical`): Which way the events run.
564
+ - `data-current`: Present when the event's status is `current`.
565
+ - `data-upcoming`: Present when the event's status is `upcoming`.
566
+
567
+ ### TimelineDescription
568
+ `[data-slot="timeline-description"]`
569
+
570
+ - `data-complete`: Present when the event's status is `complete`.
571
+ - `data-orientation` (`horizontal`, `vertical`): Which way the events run.
572
+ - `data-current`: Present when the event's status is `current`.
573
+ - `data-upcoming`: Present when the event's status is `upcoming`.
574
+
575
+ ## API Reference
576
+
577
+ ### Timeline
578
+
579
+ - `orientation?` (`TimelineOrientation`): Which arrow keys move between events: up and down, or left and right.
580
+ - `loop?` (`boolean`): Whether arrow keys wrap from the last event to the first.
581
+ - `feed?` (`boolean`): Whether the events are a feed that loads more as people scroll, rather than a list. Each event becomes an article with its position, and Page Down and Page Up move between them from anywhere inside one.
582
+ - `busy?` (`boolean`): Whether a feed is loading or changing events, which sets `aria-busy` so screen readers wait until it's done. Only a feed reads it.
583
+ - `controller?` (`{ focus: (value?: string) => void; }`): Focuses an event from anywhere. Create one with `createTimelineController()`.
584
+ - `debug?` (`boolean`): Logs every state change with its reason to the console, in development builds.
585
+
586
+ ### TimelineItem
587
+
588
+ - `value?` (`string`): Names the event for the controller's `focus()`. Generated when left out.
589
+ - `status?` (`TimelineStatus`): Where the event stands in a process. The `"current"` one sets `aria-current="step"` and takes the tab stop first.
590
+
591
+ `TimelineMarker`, `TimelineConnector`, `TimelineTime`, `TimelineTitle` and `TimelineDescription` take no props of their own.
592
+
593
+ ### State
594
+
595
+ What render functions and state-based class names receive on `Timeline`:
596
+
597
+ - `orientation` (`TimelineOrientation`): Which way the events run.
598
+ - `feed` (`boolean`): Whether the events are a feed rather than a list.
599
+ - `busy` (`boolean`): Whether a feed is loading or changing events.
600
+
601
+ On `TimelineItem` and every part inside it:
602
+
603
+ - `status` (`TimelineStatus | undefined`): Where the event stands in a process, or `undefined` when it has no status.
604
+ - `orientation` (`TimelineOrientation`): Which way the events run.
605
+
606
+ ### Controller
607
+
608
+ - `focus(value?)` (`(value?: string | undefined) => void`): Moves focus to an event by its `value`, or to the event that holds the tab stop.
609
+
610
+ ## Accessibility
611
+
612
+ A timeline is a `list` of `listitem`s, named with `aria-label`. With `feed`, it follows the [WAI-ARIA feed pattern](https://www.w3.org/WAI/ARIA/apg/patterns/feed/): a `feed` of `article`s, each with `aria-posinset` and `aria-setsize`, and `aria-busy` while it loads. Each event is named by its title through `aria-labelledby` and described by its time and description through `aria-describedby`. The current event has `aria-current="step"`.
613
+
614
+ ### Keyboard
615
+
616
+ The events have one tab stop, a roving focus. Tab enters on the current event, else the first, then returns to the event focused last. Markup rendered on the server holds the stop on the first event until it hydrates.
617
+
618
+ | Key | Action |
619
+ | -------------------------- | ---------------------------------------------------------- |
620
+ | `ArrowDown` / `ArrowUp` | Move focus between events in a vertical timeline |
621
+ | `ArrowRight` / `ArrowLeft` | Move focus between events in a horizontal timeline |
622
+ | `Home` / `End` | Focus the first or last event |
623
+ | `PageDown` / `PageUp` | In a feed, focus the next or previous article, from inside |
624
+ | `Tab` | Move from an event to the links and buttons inside it |
625
+
626
+ Arrow keys move only from an event itself, so controls inside keep them. In right-to-left text, Left and Right swap.
627
+
628
+ ### Tested Behavior
629
+
630
+ Every line below is an automated test.
631
+
632
+ - A busy feed sets aria-busy.
633
+
634
+ **A list of events**
635
+
636
+ - The events are a named list of list items.
637
+ - Each event is named by its title and described by its time and description.
638
+ - Tab lands on the current event, then on the links inside it, then leaves.
639
+ - The current event says it's the current step.
640
+ - Each event and its parts show its status.
641
+ - ArrowDown and ArrowUp move between events.
642
+ - ArrowLeft and ArrowRight do nothing in a vertical list.
643
+ - Home and End move to the first and last events.
644
+ - Arrow keys wrap from the last event to the first.
645
+ - Arrow keys on a link inside an event leave focus on the link.
646
+ - Page Down does nothing in a list.
647
+ - Tab comes back to the event focused last.
648
+ - Only the event with the tab stop is in the tab order.
649
+ - The first and last events are marked.
650
+ - An event added at the top becomes the first.
651
+ - Events that change places move the first and last marks.
652
+ - Each event carries its place and the list how many there are.
653
+ - The tab stop follows the current step when it moves before focus enters.
654
+ - The controller moves focus to an event.
655
+ - Markers and connectors are hidden from assistive technology.
656
+
657
+ **A list that doesn't loop**
658
+
659
+ - Arrow keys stop at either end.
660
+
661
+ **A horizontal list**
662
+
663
+ - ArrowRight and ArrowLeft move between events.
664
+ - ArrowDown and ArrowUp do nothing.
665
+
666
+ **A feed**
667
+
668
+ - The events are a named feed of articles.
669
+ - Each article says where it sits and how many there are.
670
+ - An article added at the top moves every position.
671
+ - Articles moved inside a wrapper take their new places.
672
+ - Page Down and Page Up move between articles.
673
+ - Page Down from a link inside an article moves to the next article.
674
+ - Page Down on the last article stays there.
675
+ - The feed isn't busy until it's told.
676
+
677
+ Runs in React, Vue and web components.