zalify-ui

File Upload

A component for selecting and uploading files from the user's device.

    React

    Usage

    Shortcuts

    The FileUpload component also provides a set of shortcuts for common use cases.

    FileUpload.Items

    By default, the FileUpload.Items shortcut renders the list of uploaded files.

    This might be more concise if you don't need to customize the file upload items:

    FileUpload.List

    The FileUpload.List shortcut renders the list of uploaded files. It composes the FileUpload.ItemGroup and FileUpload.Items components.

    is the same as:

    Examples

    Accepted Files

    Specify the accepted file types for upload using the accept prop.

      React

      Multiple Files

      Upload multiple files at once using the maxFiles prop.

        React

        Image Preview

        Use the FileUpload.ItemPreviewImage component to render a preview of image files.

        React

        Directory

        Use the directory prop to allow selecting a directory instead of a file.

          React

          Media Capture

          Use the capture prop to capture and upload media directly from the device camera or microphone.

          Info

          The capture prop is only supported on mobile devices.

            React

            Dropzone

            Drop multiple files inside the dropzone. Use the maxFiles prop to limit the number of files that can be uploaded at once.

            Drag and drop files here
            .png, .jpg up to 5MB

              React

              Input

              Use the FileInput component to create a trigger that looks like a text input.

              React

              Props

              Root

              Dropzone

              Item

              ItemPreview