Interface ShowFileUploadOptions

The options to configure the file upload dialog.

interface ShowFileUploadOptions {
    buttons?: MessageBubbleButtonProps[];
    description?: ReactNode;
    error?: ReactNode;
    fileUploadText?: ReactNode;
    fileUploadTitle: ReactNode;
    forcePosition?: Position;
    isDraggable?: boolean;
    loadingText?: string;
    maxFileLimit?: number;
    maxFileSize?: {
        message: string;
        size: number;
    };
    minFileLimit?: number;
    overlay?: boolean;
    text: ReactNode;
    title?: ReactNode;
    uploadButton: ReactNode;
    validate?: ((mwFile: DroppedMwFile) => Promise<{
        isValid: boolean;
        message: string;
        processedFile?: any;
    }>);
}

Hierarchy (view full)

Properties

buttons?: MessageBubbleButtonProps[]

A list of buttons that will resolve the message. By default, a Proceed button with value ok. The helper will resolve with the value of the button that was clicked.

description?: ReactNode

A description shown under the title. Usually, describes the contents of the step.

error?: ReactNode

The error message to display if the user tries to upload too many files.

fileUploadText?: ReactNode

The text of the upload file input.

fileUploadTitle: ReactNode

The title of the file upload dialog.

forcePosition?: Position

Force the position of the bubble.

isDraggable?: boolean

If true, the bubble will be draggable. Default true

loadingText?: string

The text to display while the file is being uploaded.

maxFileLimit?: number

The maximum number of files that can be uploaded.

maxFileSize?: {
    message: string;
    size: number;
}

Pre-validation of file size, before converting to base64.

minFileLimit?: number

The minimum number of files that can be uploaded.

overlay?: boolean

Obscure the content behind the message and prevent interaction.

text: ReactNode

Markdown text to show in the content. Usually, the instructions for the current step. It also accepts ReactNodes.

title?: ReactNode

A title shown in the header. Usually, the title of the step.

uploadButton: ReactNode

The label to use for the upload button.

validate?: ((mwFile: DroppedMwFile) => Promise<{
    isValid: boolean;
    message: string;
    processedFile?: any;
}>)

A function that takes a DroppedFile object and returns a promise that resolves to an object with isValid and message properties. If the isValid property is false, the message property should contain an error message. If the isValid property is true, the message property should be empty. If the validate function is not provided, all files will be considered valid.