Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

FileUpload

Drop files or use the browse button. Accepted files appear as removable rows.

import { FileUpload } from '@manti-ui/react';

export default function FileUploadBasic() {
  return (
    <div className="w-full max-w-[calc(var(--manti-space-16)*6)]">
      <FileUpload label="Attachments" variant="primary" maxFiles={5} />
    </div>
  );
}

Restrictions

Use accept, maxFiles, and maxFileSize to validate selection.

Drag files here or browse

API

PropTypeDefaultDescription
labelReactNodeOptional label.
hintReactNode'Drag files here or browse'Dropzone hint text.
triggerLabelReactNode'Browse files'Browse-button label.
variantMantiVariant'primary'Accent variant.
acceptstring | string[]Accepted MIME types / extensions.
maxFilesnumberMaximum number of files.
maxFileSizenumberMaximum size per file, in bytes.
onFilesChange(files: File[]) => voidCalled whenever the accepted file list changes.
disabledbooleanDisable the dropzone.
namestringForm field name.

Styling

Anatomy

PartSelectorDescription
root[data-scope="file-upload"][data-part="root"]The wrapper; carries data-variant.
label[data-scope="file-upload"][data-part="label"]The label.
dropzone[data-scope="file-upload"][data-part="dropzone"]The drag-and-drop target.
trigger[data-scope="file-upload"][data-part="trigger"]The browse button that opens the file picker.
item-group[data-scope="file-upload"][data-part="item-group"]The list of accepted files.
item[data-scope="file-upload"][data-part="item"]A single accepted file row.
item-name[data-scope="file-upload"][data-part="item-name"]The file name.
item-size-text[data-scope="file-upload"][data-part="item-size-text"]The formatted file size.
item-delete-trigger[data-scope="file-upload"][data-part="item-delete-trigger"]Removes a file from the list.

Tokens

TokenControls
--manti-file-upload-gapgap
--manti-file-upload-label-font-sizelabel font size
--manti-file-upload-dropzone-gapdropzone gap
--manti-file-upload-dropzone-paddingdropzone padding
--manti-file-upload-dropzone-radiusdropzone radius
--manti-file-upload-dropzone-font-sizedropzone font size
--manti-file-upload-trigger-heighttrigger height
--manti-file-upload-trigger-padding-xtrigger padding x
--manti-file-upload-trigger-radiustrigger radius
--manti-file-upload-trigger-font-sizetrigger font size
--manti-file-upload-item-gapitem gap
--manti-file-upload-item-group-gapitem group gap
--manti-file-upload-item-padding-xitem padding x
--manti-file-upload-item-padding-yitem padding y
--manti-file-upload-item-radiusitem radius
--manti-file-upload-item-font-sizeitem font size
--manti-file-upload-item-size-font-sizeitem size font size
--manti-file-upload-delete-trigger-sizedelete trigger size
--manti-file-upload-delete-trigger-radiusdelete trigger radius

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub