VelocityUI logoVelocityUI

FileUpload

Drag-and-drop file upload zone with click-to-browse fallback. Shows selected files in a removable list and validates against an optional maxSize cap.

Import

tsx
import { FileUpload } from '@velocityuikit/velocityui'

Preview

Basic

Attachment

Multiple files

Gallery images

Disabled

Upload (disabled)

Props

PropTypeDefaultDescription
onChange(files: File[]) => voidCallback fired when the file selection changes.
acceptstringMIME types or file extensions to accept, e.g. "image/*" or ".pdf".
multiplebooleanfalseAllows selecting multiple files.
maxSizenumberMaximum file size in bytes. Triggers an error message if exceeded.
labelstringLabel displayed above the drop zone.
hintstringHint text rendered inside the drop zone.
errorstringError message rendered below the drop zone.
disabledbooleanfalseDisables interaction.

Examples

Basic

tsx
import { FileUpload } from '@velocityuikit/velocityui'

export default function Example() {
  return (
    <FileUpload
      label="Attachment"
      hint="PNG, JPG, PDF up to 10 MB"
      onChange={(files) => console.log(files)}
    />
  )
}

Multiple files with size limit

tsx
import { FileUpload } from '@velocityuikit/velocityui'

export default function Example() {
  return (
    <FileUpload
      multiple
      accept="image/*"
      maxSize={5 * 1024 * 1024}
      label="Gallery images"
      hint="Up to 5 MB each"
      onChange={(files) => console.log(files)}
    />
  )
}

Theming

Apply a named theme class to <body> or any parent element. All VelocityUI components inside that element will automatically adopt its colors, shadows, and effects. Combine with a density modifier for complete control:

css
/* Pick any named theme */
<body class="vui-theme-ocean">

/* Add a density modifier (optional) */
<body class="vui-theme-midnight vui-density-compact">
<body class="vui-theme-construction vui-density-spacious">

/* Available themes */
/* default  midnight  ocean  tangerine */
/* construction  glass  soft  high-contrast  monochrome-red */

/* Available densities */
/* vui-density-compact  vui-density-comfortable  vui-density-spacious */