HextaUI

File input (UI SDK): Disabled

A disabled file input ignores picks, drops and pastes, and submits nothing.

Uploads are paused

Drops and pastes are ignored while the file input is disabled.

import {
  FileInput,
  FileInputDropzone,
  FileInputDropzoneDescription,
  FileInputDropzoneIcon,
  FileInputDropzoneTitle,
  FileInputTrigger,
} from "@/components/ui/ui-sdk-file-input"

function UiSdkFileInputDisabled() {
  return (
    <FileInput disabled className="max-w-md">
      <FileInputDropzone>
        <FileInputDropzoneIcon />
        <FileInputDropzoneTitle>Uploads are paused</FileInputDropzoneTitle>
        <FileInputDropzoneDescription>
          Drops and pastes are ignored while the file input is disabled.
        </FileInputDropzoneDescription>
        <FileInputTrigger className="mt-3">Browse files</FileInputTrigger>
      </FileInputDropzone>
    </FileInput>
  )
}

export { UiSdkFileInputDisabled }

This adds the example as components/examples/ui-sdk-file-input/disabled.tsx, together with the File input component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/ui-sdk-file-input-disabled.json

To add only the component, follow the File input installation.

Props in this example

The File input props this example sets, from the API reference.

PropTypeDefault
disabled
booleanfalse

Every prop is in the File input API reference.

See them all, with keyboard support and accessibility notes, on the File input page.