Skip to content
Skip to Content
ComposerKit

Quickstart

Configure the @composerkit shadcn registry and render your first component in a Next.js app.

ComposerKit distributes React components for chat interfaces and data-dense workspaces through the shadcn registry at https://composerkit.dynd.ai/r/{name}.json. Installing an item copies its TypeScript source, internal dependencies, and CSS tokens directly into your src/ folder.

AreaHighlightsWhere to go next
Chat and AIcomposer, conversation-view, tool-call, reasoning, diff, markdownComposer reference
Data workspacedata-grid, charts, scheduler, tree-view, date-time-pickerData grid guide
Design systemSingle DESIGN.md token pipeline, nested .light and .dark scopesTheming guide
Shared primitivesbutton, checkbox, text-field, select, date-picker, dialog, tabsGallery

This tutorial sets up the @composerkit registry and renders a working InlineComposer in a fresh Next.js app. No AI service or API key is needed. Use Node.js 26 and npm in an empty folder named composerkit-demo.

1. Create the app

npx --yes create-next-app@latest . --yes --use-npm --disable-git --src-dir

2. Add the ComposerKit registry

The first command initializes shadcn in the app. The second command maps the @composerkit namespace to the public ComposerKit registry.

npx shadcn@latest init --defaults --yes
npx shadcn registry add '@composerkit=https://composerkit.dynd.ai/r/{name}.json'

3. Add the Composer

This command copies the Composer, its internal dependencies, and the ComposerKit stylesheet into src/. It replaces the starter src/lib/utils.ts with the ComposerKit helper.

npx shadcn add @composerkit/composer --overwrite --yes

Replace the starter global stylesheet so Tailwind CSS v4 loads the ComposerKit tokens and theme scopes.

src/app/globals.css
@import "../styles/globals.css";

4. Render the Composer

Replace src/app/page.tsx with the file below. Keep "use client" at the top because the page holds the draft text in React state.

src/app/page.tsx
"use client";

import { InlineComposer } from "@/components/ui/composer";
import { TooltipProvider } from "@/components/ui/tooltip";
import { useState } from "react";

export default function Home() {
  const [draft, setDraft] = useState("");
  const [sentText, setSentText] = useState("");

  return (
    <main className="bg-background text-foreground min-h-dvh p-8">
      <div className="mx-auto max-w-2xl">
        <TooltipProvider>
          <InlineComposer
            canCancel={false}
            canSubmit={draft.trim() !== ""}
            label="Write a message"
            multiline
            onCancel={() => {}}
            onSubmit={() => {
              setSentText(draft);
              setDraft("");
            }}
            submitLabel="Send"
          >
            <textarea
              aria-label="Write a message"
              className="w-full resize-none bg-transparent outline-none"
              onChange={(event) => setDraft(event.target.value)}
              placeholder="Write a message"
              rows={1}
              value={draft}
            />
          </InlineComposer>
        </TooltipProvider>
        <p aria-live="polite" className="mt-4">
          {sentText}
        </p>
      </div>
    </main>
  );
}

5. Run the development server

npm run dev -- --port 3060

Open http://localhost:3060. Type a message and press Enter to see the submitted text rendered below the composer.

6. Verify the production build

Stop the development server with Ctrl+C, then run the production build.

npx next build

Next.js prints / as a static route and exits without errors.

Next steps

  • Install workspace components with the same registry: @composerkit/data-grid, @composerkit/charts, @composerkit/scheduler, @composerkit/tree-view, or @composerkit/date-time-picker.
  • Read the Data grid guide, Charts guide, Scheduler guide, Date pickers guide, and Theming guide.
  • For coding agents, fetch /llms.txt for the index or /llms-full.txt for the full documentation bundle.

On this page