Skip to content
kitn AI/UI

Introduction

AI/UI (@kitn.ai/ui) is a set of web components for AI chat and agent UIs — message threads, prompt input, streaming responses, markdown and code rendering, reasoning and tool-call panels, attachments, a conversation sidebar, and more. 80 elements, all named kai-*, all droppable into the app you already have.

The kai-* elements are real custom elements. You register them once, then use <kai-chat> (and the rest) like any built-in HTML tag — in React, Vue, Svelte, Angular, or a plain .html file. There’s no per-framework package to install and no wrapper to learn.

Each element renders inside its own Shadow DOM. Your page’s CSS can’t leak in and break the kit; the kit’s styles can’t leak out and break your page. You get a clean, isolated component you can drop anywhere.

Register everything with one import:

import '@kitn.ai/ui/elements';

Then it’s just HTML:

<kai-chat style="display: block; height: 100vh;"></kai-chat>
<script type="module">
import '@kitn.ai/ui/elements';
await customElements.whenDefined('kai-chat');
const chat = document.querySelector('kai-chat');
// Arrays can't be HTML attributes, so set messages in JavaScript.
chat.messages = [
{ id: '1', role: 'assistant', parts: [{ type: 'text', text: 'Hello! How can I help?' }] },
];
chat.addEventListener('kai-submit', (e) => {
console.log('user sent:', e.detail.value);
});
</script>

Two things carry across every element: rich data (messages, models, context, items) goes on a JavaScript property, and the element talks back through CustomEvents named kai-*. Scalars like placeholder, loading, and theme work as plain attributes.

Same element everywhere. Only the syntax for passing a property and binding an event changes.

import { Chat } from '@kitn.ai/ui/react';
<Chat
messages={messages}
onSubmit={(e) => handleSubmit(e.detail.value)}
/>

React is the one framework that gets a thin extra layer: @kitn.ai/ui/react ships typed wrappers that turn events into onEventName props, so you skip the .prop and addEventListener ceremony. Everywhere else, you use the elements straight.

The kit ships 80 elements, from a full <kai-chat> down to single building blocks like a markdown renderer or a tool-call panel. Reach for the high-level ones to ship fast, the small ones to compose your own layout.

ComponentWhat it does
kai-chatFull chat panel — messages plus prompt input in one element
kai-workspaceChat plus a conversation sidebar
kai-messageA single message row with actions
kai-prompt-inputComposer with voice, slash commands, and a toolbar
kai-markdownMarkdown renderer with optional syntax highlighting
kai-reasoningExpandable reasoning / chain-of-thought panel
kai-toolTool-call display (name, input, output)
kai-attachmentsFile attachment tiles, chips, or rows
kai-conversationsConversation sidebar with grouping
kai-artifactMulti-file artifact viewer with tabs and maximize