Skip to content
Kits

ChatComposer

Message composer with controlled text, Enter or ⌘ Enter submit, caret text insertion, and trigger-menu support.

Composition

Anatomy

  • <ChatComposer>
    • <ChatComposerShell>
      • <ChatComposerAccent />
      • <ChatComposerTextarea />
      • <ChatComposerToolbar>
        • <ChatComposerTools />
        • <ChatComposerSubmit />
        </ChatComposerToolbar>
      • <ChatComposerFooter />
      </ChatComposerShell>
    </ChatComposer>

Installation

Use this command to install the component.

Registry command
See registry manifest

Usage

Dependencies

Behavior hooksrc/registry/hooks/use-chat-composer.tsHook
Editor motion (blur choreography)src/registry/sources/control-ui/chat-composer-editor.cssSupport
Rich editor (ProseMirror)src/registry/sources/control-ui/chat-composer-editor.tsxSupport
Mention extensionsrc/registry/sources/control-ui/chat-composer-editor/extensions/mention.tsxSupport
Exit-animation ghostsrc/registry/sources/control-ui/chat-composer-editor/ghost.tsSupport
Editor schemasrc/registry/sources/control-ui/chat-composer-editor/schema.tsSupport
Serializesrc/registry/sources/control-ui/chat-composer-editor/serialize.tsSupport
Extension contractsrc/registry/sources/control-ui/chat-composer-editor/types.tsSupport
Motionsrc/registry/lib/motion.tsUtil
ButtonbuttonPrimitiveChatMessagechat-messageComponentLive statuslive-statusPrimitiveSpinnerspinnerPrimitiveTrigger Menutrigger-menuPrimitive

Raw code

Installed component source and support files

src/registry/sources/control-ui/chat-composer.tsx

Available extensions

Optional, separately installed items this surface can host — not part of the component’s bundle.

SendAuroraAnchored

Anchored ChatComposer extension: a blurred aurora backdrop that sweeps up once per sent message — activated from skin.config via the chat-composer:send-layer anchor.

Install

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-chat-composer-* · 15 knobsHow the cascade resolves
--cui-chat-composer-root-background<color>transparent
--cui-chat-composer-shell-radius<length-percentage>var(--radius-composer)
--cui-chat-composer-shell-background<color>var(--card)
--cui-chat-composer-shell-background-image*none
--cui-chat-composer-shell-backdrop-filter*none
--cui-chat-composer-shell-border-color<color>var(--border)
--cui-chat-composer-shell-border-width<length>var(--control-rim-width)
--cui-chat-composer-shell-shadow*var(--shadow-md)
--cui-chat-composer-input-foreground<color>var(--card-foreground)
--cui-chat-composer-input-placeholder-foreground<color>var(--muted-foreground)
--cui-chat-composer-mention-background<color>oklch(from var(--primary) l c h / 0.1)
--cui-chat-composer-mention-radius<length-percentage>var(--radius-popup-item)
--cui-chat-composer-mention-icon-radius<length-percentage>min(var(--radius-sm), calc(var(--spacing) * 1))
--cui-chat-composer-mention-border-color<color>transparent
--cui-chat-composer-mention-border-width<length>0px