22 elements
skip the tree
system / ai22 elements

AI

shadcn's AI Elements for agent interfaces, rebuilt on our parts. A tool call, a plan step or a task is one Trace line, and only a line that failed is red.

the layer

src/components/ai
elements
22
one line
ui/trace.tsx
a failure
signal

ai / tool

states · verbs
states
 M src/components/ui/trace.tsx
?? src/components/ai/tool.tsx
Denied rm -rf .nextRunning pnpm test
verbs
Running pnpm iconsFailed to run pnpm dev
marginai/tool.tsx
phases
running · done
also
failed · denied
line
a Trace row
logic
src/lib/ai-tool.ts
tests
ai-tool.test.ts

A tool call is one line with its verb and its object. A failed call is a Fault: the line takes signal.

ai / steps

statuses · failed
statuses
Read src/app/globals.css971 linesSearched for --radius3 filesRunning pnpm tokensRun pnpm tokens:check
failed
Ran pnpm lint
marginai/steps.tsx
parts
AgentSteps, StepGroup
statuses
4
pending
muted
running
bone
error
signal
logic
src/lib/ai-steps.ts

The steps of an agent read as a log. Only the step that failed is red.

ai / chat-thread

thread · confirmation
Which parts have no preview?

Every part has a preview.

And a /system specimen?

Yes. specimens.tsx imports each preview.

confirmation
Run pnpm icons?

It rewrites src/lib/icons/set.ts and glyphs.tsx.

marginai/chat-thread.tsx
turns
ChatTurn
scroll
MessageScroller
a reply
copies as text
under it
PromptInput
to ask
Confirmation

The thread keeps to the left measure. The prompt sits at the foot, like the Command line.

plates / ai

22 plates

Each AI Element, live. A plate opens the element's Panel with every story.

chain-of-thought2
Read the build log for the last previewSearched the web for next.js image cache keySearched the code for cacheKey2 files
chat-thread1
Which parts have no preview?

Every part has a preview.

And a /system specimen?

Yes. specimens.tsx imports each preview.

chat-turn1
Why is the copy button not red?

Red is for the Primary action and for Faults only.

checkpoint1
Before the theme change
confirmation1
Run pnpm icons?

It rewrites src/lib/icons/set.ts and glyphs.tsx.

context-window1
file-tree1
src
components
ai
tool.tsxadded
file-tree.tsxadded
ui
trace.tsxmodified
lib
ai-tool.tsadded
hooks
use-old-scroll.tsdeleted
AGENTS.mdmodified
inline-citation1

A popup in ui-sdk draws in the browser's top layer, so no ancestor clips it developer.mozilla.org. Placement props go on the content part ui-sdk.dev +1.

model-selector1
plan1

Every popup draws in the top layer, so the Portal parts go.

Replace the Base UI importsMove side and align to the content partRemoving the Portal partsRun the type checkerCheck each popup by keyboard
queue1
Add the ai section to /systemWrite a dtsPropsFor entry for each part
reasoning2

The preview shows the old focus ring. The ring comes from :focus-visible in globals.css, and the row sets outline-none.

stack-trace1

TypeError: Cannot read properties of undefined (reading 'title')

  1. at sharePage (src/app/_components/share-image/page.tsx:42:31)
  2. at Image (src/app/writing/opengraph-image.tsx:12:10)
steps2
Ran pnpm lint
subagent2
Ran grep -rn signal src/componentsRead DESIGN.mdOne red

Two files use red outside a Fault. Both are copied code.

suggestions1
task2
Read src/app/_components/share-image/page.tsxFailed to run pnpm build
terminal-run1
Ran pnpm install
> eslint

src/components/ai/plan.tsx
  12:7  error  'done' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)
✓ src/lib/ai-tool.test.ts (5 tests)
✓ src/lib/ai-steps.test.ts (7 tests)
test-results1
keeps small counts whole
rounds to a whole percent
tool2
 M src/components/ui/trace.tsx
?? src/components/ai/tool.tsx
Denied rm -rf .nextRunning pnpm test

every story · src/components/ai

chain-of-thoughtai/chain-of-thought.tsx
done
Read the build log for the last previewSearched the web for next.js image cache keySearched the code for cacheKey2 files
running
Read the build log for the last previewSearching the code for cacheKey
chat-threadai/chat-thread.tsx
Which parts have no preview?

Every part has a preview.

And a /system specimen?

Yes. specimens.tsx imports each preview.

chat-turnai/chat-turn.tsx
Why is the copy button not red?

Red is for the Primary action and for Faults only.

checkpointai/checkpoint.tsx
Before the theme change
confirmationai/confirmation.tsx
Run pnpm icons?

It rewrites src/lib/icons/set.ts and glyphs.tsx.

context-windowai/context-window.tsx
file-treeai/file-tree.tsx
src
components
ai
tool.tsxadded
file-tree.tsxadded
ui
trace.tsxmodified
lib
ai-tool.tsadded
hooks
use-old-scroll.tsdeleted
AGENTS.mdmodified
inline-citationai/inline-citation.tsx

A popup in ui-sdk draws in the browser's top layer, so no ancestor clips it developer.mozilla.org. Placement props go on the content part ui-sdk.dev +1.

model-selectorai/model-selector.tsx
planai/plan.tsx

Every popup draws in the top layer, so the Portal parts go.

Replace the Base UI importsMove side and align to the content partRemoving the Portal partsRun the type checkerCheck each popup by keyboard
prompt-inputai/prompt-input.tsx
default
with model
queueai/queue.tsx
Add the ai section to /systemWrite a dtsPropsFor entry for each part
reasoningai/reasoning.tsx
thinking

The preview shows the old focus ring. The ring comes from :focus-visible in globals.css, and the row sets outline-none.

thought

The preview shows the old focus ring. The ring comes from :focus-visible in globals.css, and the row sets outline-none. So the row needs its own focus look: it inverts to bone, as a Row does.

stack-traceai/stack-trace.tsx

TypeError: Cannot read properties of undefined (reading 'title')

  1. at sharePage (src/app/_components/share-image/page.tsx:42:31)
  2. at Image (src/app/writing/opengraph-image.tsx:12:10)
stepsai/steps.tsx
failed
Ran pnpm lint
statuses
Read src/app/globals.css971 linesSearched for --radius3 filesRunning pnpm tokensRun pnpm tokens:check
subagentai/subagent.tsx
done
Ran grep -rn signal src/componentsRead DESIGN.mdOne red

Two files use red outside a Fault. Both are copied code.

running
Ran grep -rn signal src/componentsReading DESIGN.md
suggestionsai/suggestions.tsx
taskai/task.tsx
failed
Read src/app/_components/share-image/page.tsxFailed to run pnpm build
tasks
Edited src/app/writing/[slug]/page.tsxEditing src/app/work/[slug]/page.tsx
terminal-runai/terminal-run.tsx
Ran pnpm install
> eslint

src/components/ai/plan.tsx
  12:7  error  'done' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)
✓ src/lib/ai-tool.test.ts (5 tests)
✓ src/lib/ai-steps.test.ts (7 tests)
test-resultsai/test-results.tsx
keeps small counts whole
rounds to a whole percent
toolai/tool.tsx
states
 M src/components/ui/trace.tsx
?? src/components/ai/tool.tsx
Denied rm -rf .nextRunning pnpm test
verbs
Running pnpm iconsFailed to run pnpm dev