FSAI Design System
Components

File Input

Drag-and-drop style file picker for single-file selection with explicit accept rules.

Overview

FileInput is the shared single-file picker used for uploads such as logos, images, and editor attachments.

It is built on react-dropzone and provides:

  • click-to-upload behavior
  • drag-active styling
  • explicit accept rules
  • optional label and helper text

Use it when the user should choose a single file and the surrounding workflow will handle the upload.

Basic Usage

<FileInput
  label="Group Image"
  placeholder="Upload image"
  accept={{ 'image/*': ['.jpg', '.jpeg', '.png'] }}
  Icon={Upload}
  handleFileChange={(file) => setValue('image', file)}
/>

Brand Settings Pattern

<FileInput
  placeholder="Upload Full Logo"
  className="h-8"
  accept={{ 'image/*': ['.jpg', '.jpeg', '.png'] }}
  Icon={Upload}
  handleFileChange={(file) => updateBrandLogo({ newFile: file, logoType: 'full' })}
/>

This is the production pattern used in BrandAppearanceSettings.tsx.

Props

PropTypeDefaultDescription
handleFileChange(file: File) => voidRequired. Called with the first accepted file.
classNamestringAdditional button classes.
acceptAcceptRequired dropzone accept map.
isUploadingFilebooleanDisables the input during upload.
labelstringOptional label above the field.
IconComponentTypeRequired leading icon.
extraInformationstringOptional helper text below the field.
placeholderstring'Upload'Text shown before a file is selected.

Important Behavior

  • only the first accepted file is used
  • selection is handled through handleFileChange, not a normal register(...) flow
  • the field shows the selected file name after selection

With react-hook-form

Use Controller or manual setValue(...), not plain register.

<Controller
  control={control}
  name="image"
  render={({ field }) => (
    <FileInput
      label="Group Image"
      accept={{ 'image/*': ['.jpg', '.jpeg', '.png'] }}
      Icon={Upload}
      handleFileChange={field.onChange}
    />
  )}
/>

Brand Dashboard Usage

PatternPathNotes
Brand logo uploadsfsai/apps/brand-dashboard/src/pages/BrandWorkspaceSettings/BrandAppearanceSettings/BrandAppearanceSettings.tsxMultiple small upload controls for different logo slots.
Organization settings logofsai/apps/brand-dashboard/src/pages/OrganizationSettings/OrganisationSettings.components.tsxCompact inline upload control.
Group chat imagefsai/apps/brand-dashboard/src/pages/Home/ChatOverview/ChatOverview.components.tsxForm-controlled image selection.
Helpdesk editor attachment uploadfsai/apps/brand-dashboard/src/pages/AdminPanel/Helpdesk/ArticleEditor.tsxUses uploading state and larger drop target presentation.

Guidelines

  • Do use accept to make file expectations explicit
  • Do wire the selected file into the surrounding upload workflow
  • Do use Controller or explicit setters in forms
  • Don't expect FileInput to handle multi-file selection
  • Don't use plain register(...) as if this were a normal text input

On this page