Stepkit/AI composer
Patterns · Original

AI composer

A local prompt composer with model selection, prompt chips, attachments, and a real submit callback.

Download ZIP
Live preview

Try it in context

Customize preview
Source delivery

Usage & source

v0.3.0
React
"use client";

import type { CSSProperties } from "react";
import { AIComposer } from "./components/stepkit/AIComposer";
import "./components/stepkit/styles.css";
import "./components/stepkit/showcase.css";

const themeStyle = {"--stepkit-bg":"#111217","--stepkit-surface":"#1b1c24","--stepkit-surface-muted":"#22232d","--stepkit-fg":"#f6f5fb","--stepkit-muted":"#a4a6b4","--stepkit-border":"#343641","--stepkit-border-strong":"#565866","--stepkit-code":"#20212a","--stepkit-shadow":"0 24px 70px rgba(0, 0, 0, .34)","--stepkit-accent":"#057052","--stepkit-accent-strong":"#034b38","--stepkit-accent-soft":"#153f35","--stepkit-accent-on-soft":"#63d4b2","--stepkit-accent-text":"#ffffff","--stepkit-error":"#ff9ba9","--stepkit-placeholder":"#b8bac6","--stepkit-radius":"16px","--stepkit-space":"16px","--stepkit-control-height":"44px","--stepkit-font-sans":"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif"} as CSSProperties;

export default function Example() {
  return (
    <div className="stepkit-theme" data-stepkit-preset="modern" style={themeStyle}>
      <AIComposer
      title={"What are you making room for?"}
      description={"A focused prompt surface for the first useful pass."}
      />
    </div>
  );
}

Dependencies

[email protected]
[email protected]
Add to your project

Install

Use the registry command or download the complete source archive.

npx [email protected] add https://vstepanov.com/stepkit/r/ai-composer.json
Assistant handoff

Integration prompt

Prompt
Install Stepkit AI composer 0.3.0 from the registry and preserve the included MIT notice.
npx [email protected] add https://vstepanov.com/stepkit/v0.3.0/r/ai-composer.json
Install the tested runtime dependencies exactly: npm install [email protected] [email protected]
Keep the component source, shared styles, NOTICE.md, and provenance files together. Apply the theme tokens on a wrapper rather than passing theme keys as component props.

Usage:
```tsx
"use client";

import type { CSSProperties } from "react";
import { AIComposer } from "./components/stepkit/AIComposer";
import "./components/stepkit/styles.css";
import "./components/stepkit/showcase.css";

const themeStyle = {"--stepkit-bg":"#f7f7f8","--stepkit-surface":"#ffffff","--stepkit-surface-muted":"#f0f0f3","--stepkit-fg":"#17181c","--stepkit-muted":"#626572","--stepkit-border":"#e3e4e9","--stepkit-border-strong":"#c8cad3","--stepkit-code":"#f1f1f4","--stepkit-shadow":"0 20px 60px rgba(31, 26, 64, .10)","--stepkit-accent":"#6950df","--stepkit-accent-strong":"#5137c7","--stepkit-accent-soft":"#eeeafd","--stepkit-accent-on-soft":"#5137c7","--stepkit-accent-text":"#ffffff","--stepkit-error":"#b43145","--stepkit-placeholder":"#626572","--stepkit-radius":"16px","--stepkit-space":"16px","--stepkit-control-height":"44px","--stepkit-font-sans":"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif"} as CSSProperties;

export default function Example() {
  return (
    <div className="stepkit-theme" data-stepkit-preset="modern" style={themeStyle}>
      <AIComposer
      title={"What are you making room for?"}
      description={"A focused prompt surface for the first useful pass."}
      />
    </div>
  );
}
```

Selected bounded settings: {"title":"What are you making room for?","description":"A focused prompt surface for the first useful pass."}.
Selected theme: {"mode":"light","accent":"violet","radius":"soft","density":"comfortable","preset":"modern"}.
API

Props

NameTypeDefaultDescription
valuestringundefinedControlled prompt value.
onValueChange(value: string) => voidundefinedCalled after prompt edits.
modelsstring[]default modelsModel labels in the selector.
onSubmit(payload: AIComposerSubmitPayload) => voidundefinedReceives the prompt, model, and local attachment names.
onAttachmentChange(files: File[]) => voidundefinedCalled after local file selection.
titlestring"What are you making room for?"Composer heading.
Quality

Accessibility & limits

  • Uses an associated label for the multiline prompt and model selector.
  • Attachment input remains keyboard accessible despite its visual treatment.
  • Submit is disabled for an empty prompt and status is announced politely.

Limitations

  • The component does not call a backend; the submit callback belongs to the consuming application.
Source record

Provenance

Original source under the MIT licence.

Original Stepkit implementation.

Required notices: NOTICE.md, PROVENANCE-stepkit-ai-composer.md