{"name":"streaming-text","title":"Streaming Text","description":"","kind":"block","category":"agent","status":"beta","props":{"content":{"type":"array","items":{"text":"string","cite":"number (source index) | true (first source)"},"description":"The tokens streamed so far (host-driven)."},"sources":{"type":"array","items":{"name":"string","domain":"string","href":"string","image":"string"}},"followUps":{"type":"array","items":{"0":"string"}},"done":{"type":"boolean","default":false,"description":"data-state=streaming|done"},"sourcesOpen":{"type":"boolean","default":false,"part":"sources","model":true,"description":"The sources list is open (it opens only once done)."},"fill":{"type":"boolean","default":false,"description":"Fill the parent width (and drop the reserved height) instead of the 380px measure."},"sourcesLabel":{"type":"string","default":"Sources"},"followUpsLabel":{"type":"string","default":"Follow-ups"},"statusLabel":{"type":"string","default":"Answer complete","description":"Announced once done."},"appear":{"type":"boolean","default":false,"description":"Whether what is present at mount enters: the caret fades in, cites already streamed pop in, the follow-ups of an answer mounted done rise. Off by default: set it on the answer your code adds live, never on one rendered from history or with the page (a mount is not an arrival). Cites streamed after mount and the follow-ups that come with done enter either way."}},"playground":{"name":"Playground","props":{"content":[{"text":"Kestrel"},{"text":"Logistics"},{"text":"booked"},{"text":"41%"},{"text":"fewer"},{"text":"appointments"},{"text":"in"},{"text":"October"},{"text":"than"},{"text":"in"},{"text":"September."},{"text":"","cite":0},{"text":"Their"},{"text":"admin"},{"text":"turned"},{"text":"off"},{"text":"SMS"},{"text":"reminders"},{"text":"on"},{"text":"October"},{"text":"3,"},{"text":"and"},{"text":"no-shows"},{"text":"rose"},{"text":"from"},{"text":"6%"},{"text":"to"},{"text":"19%"},{"text":"the"},{"text":"same"},{"text":"week."},{"text":"","cite":1},{"text":"Two"},{"text":"open"},{"text":"tickets"},{"text":"ask"},{"text":"how"},{"text":"to"},{"text":"turn"},{"text":"the"},{"text":"reminders"},{"text":"back"},{"text":"on."},{"text":"","cite":2}],"sources":[{"name":"Booking analytics","domain":"analytics.harbor.dev","href":"https://analytics.harbor.dev/accounts/kestrel-logistics","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%232f6fec'/%3E%3Cpath d='M17 45V25h8v20h-8Zm11 0V16h8v29h-8Zm11 0V30h8v15h-8Z' fill='%23fff'/%3E%3C/svg%3E"},{"name":"Workspace audit log","domain":"admin.harbor.dev","href":"https://admin.harbor.dev/workspaces/kestrel-logistics/audit-log","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23e56d24'/%3E%3Cpath d='M20 22h24M20 32h24M20 42h16' fill='none' stroke='%23fff' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E"},{"name":"Tickets #8812, #8830","domain":"support.harbor.dev","href":"https://support.harbor.dev/tickets?account=kestrel-logistics","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M19 18h26a5 5 0 0 1 5 5v14a5 5 0 0 1-5 5H31l-9 7v-7h-3a5 5 0 0 1-5-5V23a5 5 0 0 1 5-5Z' fill='%23fff'/%3E%3C/svg%3E"}],"followUps":["Turn SMS reminders back on for Kestrel","Which other accounts turned reminders off"],"done":true,"sourcesLabel":"3 sources"}},"exampleFiles":[{"file":"streaming","title":"Answer why an account's bookings dropped","steps":true},{"file":"done","title":"Finished answer with its sources open"}],"worstCase":[{"name":"Zero sources","props":{"content":[{"text":"Annual"},{"text":"is"},{"text":"up"},{"text":"23%"},{"text":"this"},{"text":"month."}],"sources":[],"followUps":[],"done":true}},{"name":"Fourteen sources","props":{"content":[{"text":"Annual"},{"text":"is"},{"text":"your"},{"text":"fastest-growing"},{"text":"plan"},{"text":"—"},{"text":"signups"},{"text":"are"},{"text":"up"},{"text":"23%"},{"text":"this"},{"text":"month"},{"text":"and"},{"text":"margins"},{"text":"beat"},{"text":"monthly"},{"text":"by"},{"text":"8"},{"text":"points."},{"text":"","cite":0},{"text":"Team-tier"},{"text":"plans"},{"text":"are"},{"text":"trending"},{"text":"in"},{"text":"the"},{"text":"same"},{"text":"range."}],"sources":[{"name":"Source 1 — regional SaaS pricing report","domain":"report-1.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M20 36c0 7 5.4 12 12 12s12-5 12-12H20Z' fill='%23fff'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23bff3dd'/%3E%3C/svg%3E"},{"name":"Source 2 — regional SaaS pricing report","domain":"report-2.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%232f6fec'/%3E%3Cpath d='M15 43 27 31l8 7 14-18' fill='none' stroke='%23fff' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"},{"name":"Source 3 — regional SaaS pricing report","domain":"report-3.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23e56d24'/%3E%3Cpath d='M17 45V25h8v20h-8Zm11 0V16h8v29h-8Zm11 0V30h8v15h-8Z' fill='%23fff'/%3E%3C/svg%3E"},{"name":"Source 4 — regional SaaS pricing report","domain":"report-4.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M20 36c0 7 5.4 12 12 12s12-5 12-12H20Z' fill='%23fff'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23bff3dd'/%3E%3C/svg%3E"},{"name":"Source 5 — regional SaaS pricing report","domain":"report-5.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%232f6fec'/%3E%3Cpath d='M15 43 27 31l8 7 14-18' fill='none' stroke='%23fff' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"},{"name":"Source 6 — regional SaaS pricing report","domain":"report-6.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23e56d24'/%3E%3Cpath d='M17 45V25h8v20h-8Zm11 0V16h8v29h-8Zm11 0V30h8v15h-8Z' fill='%23fff'/%3E%3C/svg%3E"},{"name":"Source 7 — regional SaaS pricing report","domain":"report-7.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M20 36c0 7 5.4 12 12 12s12-5 12-12H20Z' fill='%23fff'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23bff3dd'/%3E%3C/svg%3E"},{"name":"Source 8 — regional SaaS pricing report","domain":"report-8.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%232f6fec'/%3E%3Cpath d='M15 43 27 31l8 7 14-18' fill='none' stroke='%23fff' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"},{"name":"Source 9 — regional SaaS pricing report","domain":"report-9.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23e56d24'/%3E%3Cpath d='M17 45V25h8v20h-8Zm11 0V16h8v29h-8Zm11 0V30h8v15h-8Z' fill='%23fff'/%3E%3C/svg%3E"},{"name":"Source 10 — regional SaaS pricing report","domain":"report-10.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M20 36c0 7 5.4 12 12 12s12-5 12-12H20Z' fill='%23fff'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23bff3dd'/%3E%3C/svg%3E"},{"name":"Source 11 — regional SaaS pricing report","domain":"report-11.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%232f6fec'/%3E%3Cpath d='M15 43 27 31l8 7 14-18' fill='none' stroke='%23fff' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"},{"name":"Source 12 — regional SaaS pricing report","domain":"report-12.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23e56d24'/%3E%3Cpath d='M17 45V25h8v20h-8Zm11 0V16h8v29h-8Zm11 0V30h8v15h-8Z' fill='%23fff'/%3E%3C/svg%3E"},{"name":"Source 13 — regional SaaS pricing report","domain":"report-13.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M20 36c0 7 5.4 12 12 12s12-5 12-12H20Z' fill='%23fff'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23bff3dd'/%3E%3C/svg%3E"},{"name":"Source 14 — regional SaaS pricing report","domain":"report-14.saas-pricing-insights.example.com","href":"https://example.com/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%232f6fec'/%3E%3Cpath d='M15 43 27 31l8 7 14-18' fill='none' stroke='%23fff' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"}],"followUps":["Which plans convert best in Q4","Compare annual and monthly margins","What should we retire before Q4 so the sales team's time goes to the plans that actually sell?"],"done":true,"sourcesOpen":true,"sourcesLabel":"14 sources"}},{"name":"Unbreakable text","props":{"content":[{"text":"See"},{"text":"https://metricbase.io/reports/2025/q4/plan-velocity/annual-vs-monthly-margin-comparison-final.csv"},{"text":"","cite":0}],"sources":[{"name":"Metric Base","domain":"metricbase.io","href":"https://metricbase.io/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M20 36c0 7 5.4 12 12 12s12-5 12-12H20Z' fill='%23fff'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23bff3dd'/%3E%3C/svg%3E"}],"done":true}},{"name":"Right-to-left","props":{"content":[{"text":"שנתי"},{"text":"הוא"},{"text":"התוכנית"},{"text":"הצומח"},{"text":"ביותר"},{"text":"—"},{"text":"ההרשמות"},{"text":"עלו"},{"text":"ב־23%"},{"text":"החודש."},{"text":"","cite":0},{"text":"خطط"},{"text":"الفرق"},{"text":"ذات"},{"text":"الصغيرة"},{"text":"تتجه"},{"text":"في"},{"text":"النطاق"},{"text":"نفسه."}],"sources":[{"name":"Metric Base","domain":"metricbase.io","href":"https://metricbase.io/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231f7a5f'/%3E%3Cpath d='M20 36c0 7 5.4 12 12 12s12-5 12-12H20Z' fill='%23fff'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23bff3dd'/%3E%3C/svg%3E"},{"name":"Trends Index","domain":"trends.google.com","href":"https://trends.google.com/trends/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%232f6fec'/%3E%3Cpath d='M15 43 27 31l8 7 14-18' fill='none' stroke='%23fff' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"},{"name":"Market Basket","domain":"marketbasket.io","href":"https://marketbasket.io/","image":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23e56d24'/%3E%3Cpath d='M17 45V25h8v20h-8Zm11 0V16h8v29h-8Zm11 0V30h8v15h-8Z' fill='%23fff'/%3E%3C/svg%3E"}],"followUps":["אילו תוכניות נמכרות הכי טוב ברבעון הרביעי"],"done":true,"sourcesLabel":"3 מקורות"}}],"anatomy":[{"part":"root","element":"div","description":"data-state=streaming|done; aria-busy while streaming"},{"part":"status","element":"span","description":"role=status, sr-only; says the status label once done (the words themselves are not announced)"},{"part":"text","element":"p"},{"part":"caret","element":"span","description":"follows the words; keeps its box (hidden) when done"},{"part":"cite","element":"a","repeat":true,"description":"inline source chip: avatar + domain, on the text baseline; pops in"},{"part":"cite-avatar","element":"span","description":"The source's Avatar (12px square, decorative): its image over its initials"},{"part":"actions","element":"div","description":"hidden (but holding its space) while streaming; fades in when done"},{"part":"action","element":"button","repeat":true,"description":"copy · retry · thumbs up · thumbs down: a Button (xs, square, ghost, rounded, muted) with aria-label, a tooltip of the same text, and data-action"},{"part":"sources","element":"div","optional":true,"description":"A collapsible (variant inline, no caret) whose root lays out as part of the actions row (display: contents): its trigger (avatar stack + label) follows the actions, its region wraps onto its own line below them. aria-expanded, aria-controls and data-state from the engine; a closed list is hidden. It opens only once done"},{"part":"avatars","element":"span","description":"first three source images, aria-hidden"},{"part":"avatar","element":"span","repeat":true,"description":"An Avatar, 14px round, ringed in the page colour; the first three sources"},{"part":"sources-label","element":"span"},{"part":"sources-list","element":"div"},{"part":"source","element":"a","repeat":true},{"part":"source-avatar","element":"span","description":"An Avatar, 16px square, decorative"},{"part":"source-name","element":"span"},{"part":"source-domain","element":"span"},{"part":"followups","element":"div"},{"part":"followups-title","element":"p"},{"part":"followups-list","element":"div"},{"part":"followup","element":"button","repeat":true,"description":"--fndn-row-index (set at render) staggers the entrance when done"},{"part":"followup-text","element":"span"}],"events":{"followUp":"(text, index)","action":"(name: copy|retry|up|down)","sourcesOpenChange":"(open)"},"states":["streaming","done","sources-open","cite-hover","cite-press","action-press","followup-hover","followup-press","focus-visible"],"tokens":["color.ink","color.ink-2","color.ink-3","color.inset","color.hover","color.hover-2","color.surface","color.canvas","color.line","shadow.hairline","radius.pill","radius.chip","radius.card","text.xs","text.sm","font.mono","duration.fast","duration.base","duration.press","duration.popup","duration.reveal","duration.slow","duration.enter","duration.stagger","motion.stagger-max","motion.press-scale","easing.out-strong"],"a11y":{"keyboard":["Actions, the sources toggle and follow-ups are buttons (Enter / Space); while streaming they are hidden and out of the tab order","Sources toggle: Enter / Space reveal the list at once; focus stays on the toggle (aria-expanded, aria-controls); the closed list is hidden","Each action shows a tooltip with its name on hover and keyboard focus","Cite chips and sources are links"],"notes":["aria-busy while streaming; the words are not announced one by one, the status label is announced once done.","Every icon button has an aria-label and a tooltip with the same text; the avatars are aria-hidden next to their labels."]},"motion":["caret: fndn-fade-in over duration.base, on mount only with appear; when done it fades out over duration.fast (easing.out-strong) and is hidden, keeping its box","caret stall: while streaming, when no word has arrived for duration.enter × 2 the caret blinks (fndn-caret-blink, 1s steps(1), a loop; the stalled variant, set by the adapter through streaming-text.logic.ts); the next word or done stops it","cite chip: fndn-pop-in over duration.popup when it streams in (a cite present at mount pops only with appear) (fill backwards, so :active can press afterwards); presses with --fndn-hover-2 and motion.press-scale","actions: opacity + visibility over duration.slow when done; the buttons press with the Button's scale","follow-ups: title fndn-fade-in and rows fndn-fade-up over duration.enter when done arrives (an answer mounted done shows them at once unless appear), rows staggered by duration.stagger capped at motion.stagger-max; rows hover --fndn-hover and press --fndn-hover-2","sources: the collapsible's reveal recipe (rows below move with it; instant from the keyboard)","words: no animation (they arrive too often)"]}