Skip to content
unseen.uiby Stack Unseen
Get started

Getting started

Install the package, render one component, then add what you need. Unseen UI is in early alpha, so APIs can still change between releases.

Every component from one package. Import the stylesheet once and wrap your app in AITheme.

npm install @stackunseen/ui react@^19.3.0 react-dom@^19.3.0
Install steps

1. Install from npm

You need React and ReactDOM ^19.3.0, a bundler that handles CSS imports, and the React types if you use TypeScript.

sh
npm install @stackunseen/ui react@^19.3.0 react-dom@^19.3.0

@stackunseen/ui-core comes along automatically. Pin the exact version, because alpha releases can change APIs. The latest tag points at the current prerelease; every prerelease is also tagged alpha.

Work from the source repository instead

Clone the repository, then use Node 24.13 or later within Node 24 and pnpm 11.5.0. From the repository root:

sh
pnpm install --frozen-lockfile
pnpm build:packages
pnpm dev

Open the development site. Build the packages before you start any app in the workspace that uses them.

For the static website preview:

sh
pnpm --filter @unseen-ui/docs build
node apps/docs/scripts/preview.mjs

Open the website preview. The preview serves the built site; rebuild the docs app after changing a page.

2. Render your first component

Import the base stylesheet once and wrap your interface in AITheme. In Next.js, this interactive example belongs in a Client Component; other React apps can use the same component.

Nothing saved yet.

This example keeps a draft and a saved name in memory. Nothing is sent or persisted. Copy it into a .tsx file and render <FirstExample /> from your app:

tsx
'use client';
import { useState } from 'react';
import { AITheme, Button, Field, Input } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

export function FirstExample() {
  const [name, setName] = useState('');
  const [savedName, setSavedName] = useState('');
  return (
    <AITheme>
      <form
        style={{ display: 'grid', gap: 12, maxWidth: 360 }}
        onSubmit={(event) => {
          event.preventDefault();
          setSavedName(name.trim());
        }}
      >
        <Field label="Your name" required>
          <Input
            name="displayName"
            value={name}
            maxLength={80}
            onChange={(event) => setName(event.target.value)}
          />
        </Field>
        <Button type="submit">Save locally</Button>
        <p role="status">{savedName ? `Saved locally: ${savedName}` : 'Nothing saved yet.'}</p>
      </form>
    </AITheme>
  );
}

The value and the callback live in your app. To save to a server, call your API instead of updating local state, and show the result once it answers. Read Connect to your app before you wire up tools, approvals or anything that runs actions.

Other ways to start

Already have a project? The steps above are all you need. To start fresh, or to begin from a ready-made chat, open one of these.

Start a new Next.js or Vite project

Next.js (App Router):

sh
npx create-next-app@latest my-assistant --ts --app
cd my-assistant
npm install @stackunseen/ui

Vite:

sh
npm create vite@latest my-assistant -- --template react-ts
cd my-assistant
npm install @stackunseen/ui

Then add the chat below as a component and render it from your page. In Next.js, keep the 'use client' line; in Vite it is harmless. Or let the package write it for you; it detects Next.js or Vite, never overwrites a file without --force, and --ai-sdk writes the AI SDK version with a Next.js route:

sh
npx @stackunseen/ui init
Add starters with the shadcn CLI

If your project already uses shadcn/ui, add the same starters from the Unseen UI registry. Each one installs @stackunseen/ui at this release and writes one small file into your components folder; the components themselves stay in the package, so updates arrive as new versions.

sh
npx shadcn@latest add https://unseenui.com/r/chat.json
npx shadcn@latest add https://unseenui.com/r/chat-ai-sdk.json
npx shadcn@latest add https://unseenui.com/r/theme.json

chat writes a working chat on a local host, chat-ai-sdk adds the AI SDK version and its app/api/chat/route.ts, and theme writes a scoped theme provider. To use the short @unseen/chat form, register the namespace in components.json:

json
{
  "registries": {
    "@unseen": "https://unseenui.com/r/{name}.json"
  }
}
Start from a whole chat

@stackunseen/ui/chat puts the messages, streaming reply, tool cards, suggestions and message box together. It comes with a local stand-in server that streams scripted replies, so you can see it working before you connect anything. Swap in your own server when you're ready; the Chat guide shows how.

tsx
'use client';
import { Chat, useLocalHost } from '@stackunseen/ui/chat';
import '@stackunseen/ui/styles.css';
import '@stackunseen/ui/chat.css';

export function Demo() {
  const host = useLocalHost({ suggestions: ['Summarize the plan', 'Search notes for renewals'] });
  return <Chat host={host} title="Assistant" />;
}

3. Add only the entries you need

Everyday controls come from @stackunseen/ui. Bigger pieces such as DataGrid have their own entry and stylesheet, so they only load when you use them. Keep the base CSS and AITheme from the first example.

tsx
import { DataGrid } from '@stackunseen/ui/application';
import '@stackunseen/ui/application.css';

The DataGrid guide covers rows, sorting and paging. This entry needs no extra packages.

Other optional entries and their dependencies

Each path below is part of @stackunseen/ui. Install the extra packages an entry lists only if you import that entry; React and ReactDOM are always needed. The exact supported versions are under peerDependencies in the package's package.json.

Optional @stackunseen/ui entry requirements
EntryAdditional peersExtra CSS
/theme, /status, /codeNoneNone
/markdownreact-markdown, remark-gfm, remendNone
/mathkatexkatex/dist/katex.min.css
/mermaidmermaid, dompurifyKaTeX CSS for math labels
/rich-markdownMarkdown peers, remark-math, katex, mermaid, dompurifykatex/dist/katex.min.css
/highlightshikiNone
/terminal@xterm/xterm, @xterm/addon-fit@stackunseen/ui/terminal.css
/viewport@tanstack/react-virtualNone
/layoutreact-resizable-panelsNone
/sidecar, /workspace, /uploadNoneNone

For example, a Markdown response needs these imports after installing its peers:

tsx
import { MarkdownResponse } from '@stackunseen/ui/markdown';
import '@stackunseen/ui/styles.css';

Each component's page lists the values and callbacks it needs. There are no /button or /icons paths; those come from the main entry.

4. Find your next step

Customize lets you preview appearance, colors, density and corners. Themes and icons covers AITheme, IconsProvider and building your own header and footer. To connect components to your server, read Connect to your app.

5. Notes for Next.js apps

Three things that only come up with Next.js server rendering. Open one when you need it.

Compound parts in Server Components

Compound components such as Card.Header, Sidebar.Group, Tooltip.Trigger and NavigationMenu.List are undefined when imported into a Next.js Server Component, because the client reference proxy does not carry static properties. Every part is also a top-level named export, so import those there:

tsx
import { Card, CardHeader, CardTitle, CardContent } from '@stackunseen/ui';

The property form (Card.Header) works in Client Components. Button, Tag, Stat, Stepper, Matrix, Progress, Card, Table, Breadcrumb and the marketing blocks render in Server Components. Controls with local state or handlers are Client Components that a Server Component can render: Select, Avatar, ToggleGroup, Chip, Accordion, Sidecar, Popover, Tooltip, the menus and the dialogs.

Router links

Chip, ToggleGroup in links mode, Stepper, Card and Button with href, and Matrix render native anchors by default. In Next.js that is a full document load on every filter click. Wrap the app once in LinkProvider with the router's link and every one of them renders it instead, with prefetching and client-side navigation:

tsx
import Link from 'next/link';
import { LinkProvider } from '@stackunseen/ui';

<LinkProvider component={Link}>{children}</LinkProvider>;

The provider is a Client Component that a root layout can render; the components inside keep rendering on the server. useLinkComponent returns the same component for anchors you render yourself. Disabled links stay native and have no destination.

Dark code panels on a light page

Nest a second AITheme with appearance="dark" around HighlightedCodeBlock (or any component) to render it dark inside a light page. The nested provider keeps the parent theme's colors, applies only to what it wraps, and menus or dialogs opened from inside it stay dark too.

tsx
<AITheme appearance="dark">
  <HighlightedCodeBlock code={code} language="tsx" />
</AITheme>