🚀ReacUI is currently in Beta. We're actively improving it! ❣️
File Input
A component for file uploads with enhanced styling and functionality
Installation
The FileInput component is part of the ReacUI library. Install the package to use it in your project.
Import
Import the FileInput component into your React component.
Basic Usage
The FileInput component provides a styled file input control.
Variants
Different styles and variants of the file input component.
No file selected
or drag and drop
PNG, JPG, GIF up to 10MB
With Dropzone
Enable drag and drop functionality for file uploads.
or drag and drop
Up to 5 files, max 2MB each
Validation
File input with validation states and error messages.
File meets all requirements
File too large (max 2MB)
API Reference
The following props are available for the FileInput component.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | enum | 'standard' | The visual style: 'standard', 'button', 'outline', or 'dropzone' |
| multiple | boolean | false | Whether multiple files can be selected |
| accept | string | '' | File types that can be accepted (e.g., 'image/*,application/pdf') |
| maxSize | number | Infinity | Maximum file size in bytes |
| maxFiles | number | Infinity | Maximum number of files when multiple is true |
| buttonText | string | 'Choose file' | Text for the button in button variant |
| helperText | string | '' | Helper text shown below the input |
| state | enum | 'default' | The validation state: 'default', 'valid', or 'error' |
| error | string | '' | Error message when state is 'error' |
| disabled | boolean | false | Whether the file input is disabled |
| onChange | function | - | Callback function triggered when files are selected |
| onDrop | function | - | Callback function triggered when files are dropped (for dropzone variant) |