Components/Inputs/FileInput

FileInput

Inputs

File picker with drag-and-drop zone and MIME type filtering.

Wraps a hidden native file input (type file) with a button-styled trigger. Shows the selected filename or file count. Optional clearable prop adds a dismiss button.

Usage

import { FileInput } from "nosible-ux"

export default function Example() {
  return (
    <FileInput
      label="Upload signals CSV"
      accept=".csv"
      placeholder="Select file..."
    />
  )
}

Examples

Multiple files

Select files...

Variants

Select file…
Select file…
Select file…

Accessibility

The visible trigger is a button element that programmatically clicks the hidden input. The native file dialog is opened by the browser. aria-label is derived from label when provided.

Props

Name TypeDefaultDescription
accept
string | undefinedComma-separated list of accepted MIME types or extensions.
clearable
boolean | undefinedfalseWhen true, shows a clear button after a file is selected.
description
string | undefinedHelper text below the trigger. Suppressed when `error` is present.
disabled
boolean | undefinedfalseWhether the trigger is disabled.
error
string | undefinedValidation error. Renders Critical Red text.
label
string | undefinedLabel rendered ALL-CAPS in Space Mono above the trigger.
multiple
boolean | undefinedfalseWhether the user can pick multiple files.
onChange
((files: File[]) => void) | undefinedCalled when the selection changes. Receives the selected File array.
placeholder
string | undefined"Select file…"Placeholder text shown when no file is selected.
required
boolean | undefinedRequired field flag — adds visual asterisk.
size
"sm" | "md" | "lg" | undefined"md"Visual size.
variant
"default" | "filled" | "outline" | undefined"default"Visual variant.