From components to a system
The interesting part of Prism is no longer an individual button. It is whether inputs, menus, dialogs and asynchronous responses behave like they belong to the same product. I moved the work towards shared behaviour: typed APIs, spring motion, a common overlay layer and visual expressions held to the same interaction contracts.
Keep the behaviour, change the expression
A different visual language should not require a different keyboard model or props API.
The expressions become a test of the component system rather than separate galleries. Visual variety has to survive the same behavioural checks.
Let the browser own the layer
A panel inside a transformed or clipped ancestor can disappear regardless of its z-index. Closing a native overlay immediately also cuts off its exit motion.
Escape dismisses the top layer. Closing panels stay mounted through their exit spring. Modal focus return and scroll locking belong to the shared layer, rather than each component inventing them.
Show the engineering
X-ray makes hit targets, focus order, roles, contrast and springs visible while exploring a component. Its overlay joins the top layer too, so opening a dialog does not hide the inspection tools. This exposes implementation choices; it does not certify accessibility or replace testing.
Make AI behaviour repeatable
An AI response interface needs to handle waiting, tool calls, partial answers, interruption and failure. A fresh model response on every visit would make those states difficult to compare and introduce a running cost.
The demo can be stopped, retried and inspected without a paid call. An injected tool timeout is labelled, and a wrong-source run remains visible as a failure. The interface presents response state; it does not verify whether a model claim is true.
AI interfaces beyond the answer bubble
The AI response component makes tool arguments inspectable, reveals streamed text at an even pace, links citations only when a source exists and announces the completed answer once to screen readers. Latency states and the async button share timing rules for fast starts, slow requests and retry; settled states ignore late results. Token Compose explores a different boundary: a seeded generator produces layouts from a closed token vocabulary, and a validator rejects off-token values. It is deterministic generation, not an LLM choosing a layout, and the validator checks membership rather than taste or contrast.
Inspect the AI interaction work
Installable, and what comes next
Eight components install straight into a project with the shadcn CLI, for example npx shadcn@latest add https://prism.sammii.dev/r/prism-menu.json: async button, AI response, dialog, sheet, popover, tooltip, toast and menu. Each item carries the shared hooks it needs, such as overlay.ts, anchor.ts and assistant.ts, and a test compiles every item outside the app to prove it stands alone. The next form primitives and a shared OKLCH token contract are still to come.
