{"name":"thinking-state","title":"Thinking","description":"","kind":"block","category":"agent","status":"beta","props":{"variant":{"type":"enum","values":["steps","reasoning","search","coding"],"default":"steps","description":"steps: check/spinner rows; reasoning: prose rows; search: query + link rows with globe dots; coding: pressable tool rows"},"working":{"type":"boolean","default":false,"description":"data-state=working|done"},"expanded":{"type":"boolean","default":false,"model":true,"description":"The trace is open. React: expanded / defaultExpanded / onExpandedChange; Vue: v-model:expanded; Svelte: bind:expanded."},"activeLabel":{"type":"string","default":"Thinking"},"doneLabel":{"type":"string","default":"Done thinking"},"rows":{"type":"array","items":{"primary":"string","secondary":"string?","mono":"boolean?","add":"number?","del":"number?","href":"string?"},"description":"Controlled. Rows present at first render stagger in with appear; a row appended later fades up alone."},"query":{"type":"string","description":"search variant: the query shown above the sources"},"more":{"type":"string","description":"search variant: trailer text such as '+7 more'"},"pressable":{"type":"boolean","default":false,"description":"Rows are buttons with aria-pressed (defaults on for coding)."},"tone":{"type":"enum","values":["accent","orange","green"],"default":"accent","part":"dot","description":"search dot tint, cycles by row index"},"selected":{"type":"number","model":true,"description":"Index of the pressed row (aria-pressed), or null. Pressable rows single-select."},"appear":{"type":"boolean","default":false,"description":"Whether the rows (and the search query and trailer) present at mount fade up, staggered. Off by default: set it on the trace your code adds live, never on one rendered from history or with the page (a mount is not an arrival). Rows added after mount enter either way."}},"playground":{"name":"Playground","props":{"variant":"steps","working":false,"expanded":true,"activeLabel":"Reviewing December renewals","doneLabel":"Reviewed 38 renewals","rows":[{"primary":"Loading December renewals","secondary":"38 accounts"},{"primary":"Comparing bookings with the last 90 days"},{"primary":"Matching open support tickets","secondary":"112 tickets"},{"primary":"Scoring churn risk per account"},{"primary":"Ranking by revenue at risk"},{"primary":"Writing the summary for Sofia Alvarez","secondary":"1 page"}]}},"exampleFiles":[{"file":"steps","title":"Review renewals for churn risk","steps":true},{"file":"reasoning","title":"Decide whether to roll back a deploy"},{"file":"search","title":"Research a database connection error"},{"file":"coding","title":"Fix a failing test"}],"worstCase":[{"name":"40 long steps","props":{"variant":"steps","working":true,"expanded":true,"activeLabel":"Reconciling 12,480 supplier invoices against the purchase-order ledger for fiscal year 2026","rows":[{"primary":"Reconciling invoice batch 01 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"312 line items"},{"primary":"Reconciling invoice batch 02 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"624 line items"},{"primary":"Reconciling invoice batch 03 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"936 line items"},{"primary":"Reconciling invoice batch 04 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"1,248 line items"},{"primary":"Reconciling invoice batch 05 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"1,560 line items"},{"primary":"Reconciling invoice batch 06 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"1,872 line items"},{"primary":"Reconciling invoice batch 07 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"2,184 line items"},{"primary":"Reconciling invoice batch 08 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"2,496 line items"},{"primary":"Reconciling invoice batch 09 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"2,808 line items"},{"primary":"Reconciling invoice batch 10 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"3,120 line items"},{"primary":"Reconciling invoice batch 11 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"3,432 line items"},{"primary":"Reconciling invoice batch 12 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"3,744 line items"},{"primary":"Reconciling invoice batch 13 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"4,056 line items"},{"primary":"Reconciling invoice batch 14 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"4,368 line items"},{"primary":"Reconciling invoice batch 15 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"4,680 line items"},{"primary":"Reconciling invoice batch 16 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"4,992 line items"},{"primary":"Reconciling invoice batch 17 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"5,304 line items"},{"primary":"Reconciling invoice batch 18 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"5,616 line items"},{"primary":"Reconciling invoice batch 19 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"5,928 line items"},{"primary":"Reconciling invoice batch 20 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"6,240 line items"},{"primary":"Reconciling invoice batch 21 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"6,552 line items"},{"primary":"Reconciling invoice batch 22 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"6,864 line items"},{"primary":"Reconciling invoice batch 23 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"7,176 line items"},{"primary":"Reconciling invoice batch 24 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"7,488 line items"},{"primary":"Reconciling invoice batch 25 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"7,800 line items"},{"primary":"Reconciling invoice batch 26 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"8,112 line items"},{"primary":"Reconciling invoice batch 27 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"8,424 line items"},{"primary":"Reconciling invoice batch 28 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"8,736 line items"},{"primary":"Reconciling invoice batch 29 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"9,048 line items"},{"primary":"Reconciling invoice batch 30 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"9,360 line items"},{"primary":"Reconciling invoice batch 31 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"9,672 line items"},{"primary":"Reconciling invoice batch 32 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"9,984 line items"},{"primary":"Reconciling invoice batch 33 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"10,296 line items"},{"primary":"Reconciling invoice batch 34 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"10,608 line items"},{"primary":"Reconciling invoice batch 35 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"10,920 line items"},{"primary":"Reconciling invoice batch 36 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"11,232 line items"},{"primary":"Reconciling invoice batch 37 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"11,544 line items"},{"primary":"Reconciling invoice batch 38 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"11,856 line items"},{"primary":"Reconciling invoice batch 39 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"12,168 line items"},{"primary":"Reconciling invoice batch 40 of 40 against the purchase-order ledger for Northwind Industries Holdings (EMEA)","secondary":"12,480 line items"}]}},{"name":"Long paths","props":{"variant":"coding","expanded":true,"doneLabel":"Ran 3 tools","rows":[{"primary":"Read","secondary":"apps/storefront/src/features/billing/components/InvoiceReminderScheduleTable.generated.tsx","mono":true},{"primary":"Edit","secondary":"packages/pricing-engine/src/adapters/legacy/SeasonalDiscountReconciliationService.ts","mono":true,"add":12480,"del":9731},{"primary":"Regenerate the internationalised pricing snapshots","secondary":"pnpm --filter @northwind/pricing-engine run snapshots:update -- --locale=all --force","mono":true},{"primary":"R","secondary":"x","mono":true}]}},{"name":"No rows","props":{"variant":"steps","working":true,"expanded":true,"activeLabel":"Thinking","rows":[]}},{"name":"One long word","props":{"variant":"reasoning","expanded":true,"doneLabel":"Thought for 1 hour 12 minutes","rows":[{"primary":"Donaudampfschifffahrtsgesellschaftskapitänsmützenabzeichenherstellungsbetriebsvereinbarungsentwurf_and_no_break_opportunity_anywhere_in_this_token"},{"primary":"J"}]}},{"name":"Right-to-left","props":{"variant":"search","expanded":true,"doneLabel":"تم البحث في الويب","query":"أفضل مورد لأقماع الوافل في المنطقة","more":"+١٢٬٤٨٠","rows":[{"primary":"مصنع الأقماع الذهبية للحلويات والمثلجات","secondary":"golden-gate-cloud-and-data-services.example.com","href":"https://example.com/"},{"primary":"Jo","secondary":"x.co","href":"https://example.com/"}]}}],"anatomy":[{"part":"root","element":"div","description":"data-variant, data-state=working|done; data-ready once mounted (arms the status transitions)"},{"part":"disclosure","element":"div","description":"A collapsible (variant inline, caret=\"start\"): the trigger, its caret first (collapsible-caret, right turning down; before the sparkle and the label, so a label that changes length moves nothing) and the trace region (collapsible-content > collapsible-body, which holds the rail). Its engine sets aria-expanded, aria-controls and data-state, hides the closed trace (out of the tab order) and toggles instantly from the keyboard. Not marked: it is the real Collapsible’s own part (data-slot=\"collapsible\"), which takes no attribute for it","marked":false},{"part":"trigger","element":"button","description":"The collapsible's inline trigger: hover --fndn-hover, press --fndn-hover-2. Not marked: it is the real Collapsible’s own part (data-slot=\"collapsible-trigger\"), which takes no attribute for it","marked":false},{"part":"header","element":"span","description":"The trigger's label part: the sparkle and the live label. Not marked: it is the real Collapsible’s own part (data-slot=\"collapsible-label\"), which takes no attribute for it","marked":false},{"part":"icon","element":"span","description":"Sparkle by default; decorative"},{"part":"label","element":"span","description":"role=status live region; stays mounted while its text is swapped"},{"part":"label-text","element":"span","description":"The current label. While working it is the real Shimmer (fast), marked data-thinking-state=\"label-text\"; a replacement text arrives out of a 2px blur"},{"part":"rail","element":"div"},{"part":"line","element":"span","description":"Hairline under the sparkle; the adapter sets its height so it grows to meet a row that arrives"},{"part":"rows","element":"div"},{"part":"query","element":"div","optional":true,"description":"search variant: search icon + query text"},{"part":"row","element":"div","repeat":true,"description":"div, a (href) or button (pressable, aria-pressed). --fndn-row-index only on rows present at first render"},{"part":"check","element":"span","optional":true,"description":"steps variant: check mark, or a spinner on the last row while working"},{"part":"primary","element":"span","description":"Truncates on one line (title carries the full text); wraps in the reasoning variant"},{"part":"secondary","element":"span","optional":true,"description":"Muted note; data-mono for file names and commands"},{"part":"diff","element":"span","optional":true,"description":"+added −removed counts"},{"part":"dot","element":"span","optional":true,"description":"search variant: colored globe disc per source, data-tone cycles accent/orange/green"},{"part":"more","element":"span","optional":true,"description":"search variant: '+7 more' trailer; fades in place"}],"slots":{"icon":"replace the sparkle"},"events":{"toggle":"(expanded: boolean)","rowClick":"(row, index) when a row is pressable","selectedChange":"(index | null)"},"states":["working","done","expanded","collapsed","row-hover","row-press","row-focus-visible","row-selected"],"tokens":["color.ink","color.ink-2","color.ink-3","color.line","color.hover","color.hover-2","color.inset","color.green","color.red","color.orange","color.accent","color.on-accent","radius.chip","text.2xs","text.xs","text.sm","font.mono","easing.out-strong","easing.link","duration.fast","duration.base","duration.press","duration.move","duration.slow","duration.enter","duration.stagger","motion.stagger-max"],"a11y":{"keyboard":["Tab reaches the header; Enter / Space expand or collapse the trace, focus stays on the header","While collapsed, the rows are out of the tab order","search: Tab moves through the source links; Enter opens one","coding: Tab moves through the tool rows; Enter / Space press one (aria-pressed), pressing it again releases it"],"notes":["The header is a real button with aria-expanded and aria-controls pointing at the trace.","The label is a role=status region that stays mounted; only its text changes, so working → done is announced once.","Checks, spinners, dots and the sparkle are aria-hidden.","Truncated row text carries the full value in title."]},"motion":["mount: nothing plays unless appear is set; with appear, rows present at first render fade up over duration.enter, staggered by duration.stagger and capped at motion.stagger-max; the header and the rail do not move","expand / collapse: the collapsible reveals the trace as one container (its reveal recipe; instant from the keyboard); rows do not enter again; the caret turns from right to down over duration.move","working → done: the label text is swapped through a short blur (opacity + filter over duration.base); the spinner hands over to a check that scales in from 0.5 (duration.press). Transitions armed by data-ready, so nothing plays at first paint","a row added after mount always fades up alone with no delay; the rail line grows to meet it over duration.move","label shimmer while working: the Shimmer (fast); under reduced motion it stops and shows static ink-2 text","search: animated underline on the source name on hover and focus (duration.slow, easing.link)","keyboard: nothing here animates on a key press except the reveal the user asked for"]}