smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Chat · Components

FileUpload

Attachment upload UI. Button with drag-and-drop zone. Shows file preview before upload. Supports file type filtering and max size constraints.

Public export

typescript
import { FileUpload } from '@happyvertical/smrt-chat/svelte';
Import path
@happyvertical/smrt-chat/svelte
Props
4
Props described
4 of 4
Bindable state
0
Callback events
1
Verified release
0.62.10

Props

NameTypeRequiredDescription
onupload(files: FileList) => voidYesCallback when files are selected
acceptstringNoAccepted file types (e.g., "image/*,.pdf")
maxSizenumberNoMaximum file size in bytes
disabledbooleanNoWhether the upload is disabled

Bindable state

This component has no bindable public state.

Callback events

  • onupload(files: FileList) => void

Examples and explanation