Skip to content
Kits

ChatComposerAttachment

Composer attachment rail with file previews, upload progress, and removal.

Composition

Attachment rail

  • <ChatComposerAttachments>
    • <ChatComposerAttachment>
      • <ChatComposerAttachmentPreview />
      • <ChatComposerAttachmentContent>
        • <ChatComposerAttachmentTitle />
        • <ChatComposerAttachmentDescription />
        </ChatComposerAttachmentContent>
      • <ChatComposerAttachmentRemove />
      • <ChatComposerAttachmentProgress />
      </ChatComposerAttachment>
    </ChatComposerAttachments>

File intake

The area carries drop and paste, so a screenshot pasted into the composer and a file dropped on it reach the same policy as the file dialog. Open that dialog from the toolbar with the dropzone's open(). Inside the shell, the overlay takes the shell's radius, and each fileRejections entry renders as an error attachment dismissed with removeRejection().

  • <Dropzone>
    • <DropzoneInput />
    • <DropzoneArea>
      • <ChatComposer>
        • <ChatComposerShell>
          • composer anatomy
          • <DropzoneOverlay />
          </ChatComposerShell>
        </ChatComposer>
      </DropzoneArea>
    </Dropzone>

Installation

Use this command to install the component.

Registry command
See registry manifest

Usage

Dependencies

Raw code

Installed component source and support files

src/registry/sources/control-ui/chat-composer-attachment.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-composer-attachment-* · 10 knobsHow the cascade resolves
--cui-chat-composer-attachment-radius<length-percentage>var(--radius-popover)
--cui-chat-composer-attachment-height<length-percentage>calc(var(--spacing) * 14)
--cui-chat-composer-attachment-list-padding<length-percentage>calc(var(--spacing) * 3)
--cui-chat-composer-attachment-background<color>var(--popover)
--cui-chat-composer-attachment-border-color<color>var(--control-rim)
--cui-chat-composer-attachment-shadow*inset 0 0 0 var(--control-rim-width) var(--cui-chat-composer-attachment-border-color), var(--shadow-sm)
--cui-chat-composer-attachment-backdrop-filter*blur(var(--backdrop-blur-popover))
--cui-chat-composer-attachment-progress-background<color>transparent
--cui-chat-composer-attachment-progress-foreground<color>oklch(from var(--background) l c h / var(--overlay-opacity))
--cui-chat-composer-attachment-image-outline-color<color>var(--image-outline)