Skip to content
Kits

ChatLayout

A scrolling conversation with a pinned header, message turns, and a floating composer dock.

Composition

Conversation and composer

  • <ChatLayout>
    • <ChatThread>
      • <ChatTurn>
        • <ChatMessage />
        • <Activity>
          • <ActivityTrigger>
            • <ActivityTitle />
            </ActivityTrigger>
          • <ActivityContent>
            • reasoning content
            </ActivityContent>
          </Activity>
        </ChatTurn>
      • <ChatThreadScrollButton />
      • <ChatComposer />
      </ChatThread>
    </ChatLayout>

Channel header

  • <ChatLayout>
    • <ChatLayoutHeader>
      • leading trigger
      • <ChatLayoutTitle />
      • <ChatLayoutDescription />
      • <ChatLayoutActions />
      </ChatLayoutHeader>
    • <ChatThread />
    </ChatLayout>

Installation

Use this command to install the component.

Registry command
See registry manifest

Usage

Dependencies

Use chat thread scrollsrc/registry/hooks/use-chat-thread-scroll.tsHook
Motionsrc/registry/lib/motion.tsUtil
ButtonbuttonPrimitiveChatMessagechat-messageComponentLive statuslive-statusPrimitiveScroll areascroll-areaPrimitive

Raw code

Installed component source and support files

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

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-layout-* · 7 knobsHow the cascade resolves
--cui-chat-layout-radius<length-percentage>var(--radius-scene)
--cui-chat-layout-background<color>var(--background)
--cui-chat-layout-border-color<color>var(--border)
--cui-chat-layout-border-width<length>var(--control-rim-width)
--cui-chat-layout-shadow*var(--shadow-md)
--cui-chat-layout-scroll-button-gap<length-percentage>calc(var(--spacing) * 3)
--cui-chat-layout-turn-gap<length-percentage>calc(var(--spacing) * 2)