Attachments Demo
Enable file attachments in the composer. Users can click the attach button or drag & drop files onto the widget.
How it works
Set attachments.enabled: true in the widget config. Files are converted to base64 content parts and sent alongside the message text. You can constrain allowed types, max file size, and max file count.
Configuration
Max files
1
2
4
6
8
Max file size
1 MB
5 MB
10 MB
25 MB
Allowed types
Images only
Images + PDF
All supported
Button icon
paperclip
image-plus
upload
Drop Overlay
Background
Default (light blue)
Color only (blue, no blur)
Green tint
Purple tint
Neutral
Overlay icon
upload (default)
image-plus
file-up
cloud-upload
Icon stroke width
Default (0.5)
Thin (1)
Medium (2)
Thick (2.5)
Label text
Border style
Default (dashed blue)
Dashed green
Solid blue
None
Backdrop blur
Default (8px)
None
Subtle (4px)
Heavy (16px)
Inset (margin)
None (0)
4px
8px
12px
Apply & Reload Widget
Try it
Click the attach button in the composer
Drag & drop a file onto the chat
Paste an image from your clipboard
Attach multiple files, then send a message
const config = {
attachments : {
enabled : true ,
maxFiles : 4 ,
maxFileSize : 10 * 1024 * 1024 ,
dropOverlay : {
background : 'rgba(59,130,246,0.08)' ,
iconName : 'upload' ,
label : 'Drop files here' ,
}
}
};
Event Log
Waiting for attachment events…