intelliui-npm-package: IntelliUI: The React Chat Stack That Turns AI Replies Into Interfaces

Inside the hooks, renderers, and adaptive layouts that let a response become reasoning, code, files, or a full workspace.

8 min read • View on GitHub • More from RanaHeet24

A chat bubble opens like a shell to reveal a compact workspace inside it. Separate zones inside the opened form suggest reasoning, code artifacts, and a layout panel expanding outward. The image explains IntelliUI's core idea: an AI response can grow into structured interface state instead of staying a single text block.
IntelliUI treats an answer as something that can branch into multiple surfaces, not just one markdown pane.
Key Takeaways

The chat bubble is too small

Most chat UIs assume the answer is mostly text. Maybe you get a code block, maybe a citation, maybe a copy button. IntelliUI starts from a harsher assumption: a useful AI reply often needs multiple surfaces at once, and the UI has to make room for all of them.

That changes the contract. The message is no longer just something to render. It is something to classify, route, persist, and expand into a workspace when the model starts producing artifacts instead of plain prose.

What IntelliUI thinks an AI response is

At the center of the package is a message model that behaves more like a dispatcher than a blob of markdown. The repo's `AIMessage` component checks for specific keys such as `reasoning`, `tools`, `artifacts`, and `files`, then sends each branch to a specialized renderer.

type AIMessageShape = {
  id: string;
  role: 'assistant' | 'user' | 'system';
  content?: string;
  reasoning?: string;
  tools?: Array<{ name: string; result: unknown }>;
  artifacts?: Array<{ type: string; title: string; content: string }>;
  files?: Array<{ name: string; path: string }>;
};

function AIMessage(message: AIMessageShape) {
  return (
    <>
      {message.reasoning && <ReasoningBlock />}
      {message.tools && <ToolsBlock />}
      {message.artifacts && <ArtifactPanel />}
      {message.files && <FileList />}
      <MarkdownRenderer content={message.content ?? ''} />
    </>
  );
}

One response becomes multiple UI surfaces through dispatch, not one giant renderer with conditionals scattered everywhere.

That diagram is the mental model. The package does not treat the assistant output as one thing. It treats it as structured state that can be routed into the right surface at the right time.

A close-up switchboard shows one central message object sending branches into separate renderers for text, reasoning, artifacts, and files. The composition explains that IntelliUI routes AI output through a dispatcher rather than relying on a single markdown renderer.
The core trick is routing. `AIMessage` is a switchboard, not a paragraph tag.

useChat is the orchestration layer

The most important moving part is `useChat`. It owns message state, loading state, and abort control, which is exactly where an AI UI gets real. If streaming can stop, restart, or partially fail, the hook has to keep the interface coherent while the model is still speaking.

The repo also folds in persistence and scroll behavior. Local storage hydration keeps the conversation from disappearing on refresh, while auto-scroll makes the chat feel alive without forcing the user to manage the viewport manually.

The most distinctive detail is artifact scaffolding. The implementation looks for code-like intent and can spin up an artifact instead of leaving everything inside the chat stream. That is the moment IntelliUI stops behaving like a conventional chat component and starts behaving like a workspace host.

const { messages, sendMessage, stop, isLoading } = useChat({
  provider: 'gemini',
  apiEndpoint: '/api/chat',
  onFinalize(message) {
    if (looksLikeArtifact(message.content)) {
      scaffoldArtifact(message);
    }
  }
});

// The hook keeps transport, cancellation, persistence, and layout-aware UI state together.

Provider plus adapter: swap the backend, keep the UI

`AIProvider` pushes the architecture in a useful direction. It lets the UI layer stay consistent while the transport and model backend change beneath it. That is a practical answer to a messy reality: teams do not always know which model stack they will use six months from now.

The adapter pattern is the real leverage. Instead of hard wiring the interface to one vendor, IntelliUI lets developers pass a custom send function and keep the same chat surface. For product teams, that lowers rewrite risk. For builders, it means the UI can survive backend churn.

LayerWhat stays stableWhat can change
AIProviderChat UI contractTransport, endpoint, model vendor
AdapterMessage shape and eventsFetch logic, auth, streaming protocol
useChatState and orchestrationPersistence strategy, artifact heuristics

Layouts that grow with the task

IntelliUI does not assume one screen shape fits every conversation. Its layout layer measures available space and can switch between widget, mobile, and workspace modes. That matters because an answer that begins as a chat reply may need a broader canvas a few seconds later.

This is where the project gets more interesting than a standard chat library. It is not only rendering AI output. It is negotiating the available surface area around that output, which is a different UI problem entirely.

In practice, that means the same component can feel lightweight in a sidebar and more like an IDE when artifacts or longer reasoning chains appear. The layout adapts to the task instead of forcing the task to shrink to fit the layout.

Where IntelliUI fits in the UI landscape

The comparison is not IntelliUI versus MUI buttons or Chakra spacing tokens. Those libraries solve a broader UI problem. IntelliUI solves a narrower and more opinionated one: how to build AI-native interfaces where messages can become structured work products.

ApproachWhat counts as a messageReasoning slotArtifact supportLayout adaptationBackend flexibility
Text-first chat UIMostly plain text and markdownUsually noUsually noStatic containerOften coupled to one backend
Generic component libraryWhatever the app definesNot built inNot built inApp-definedApp-defined
IntelliUIStructured AI state with branchesYesYesYesDesigned for adapters

That is the essential distinction. Generic UI kits are good at composition. IntelliUI is trying to make a specific class of AI interaction feel native, with dedicated slots for the things modern models increasingly produce.