File Input
The File Input component provides a reusable pattern for fileinput in the interface.
Fileinput by drag and drop, single file
Fileinput by drag and drop, multiple files
Fileinput with minimum number of files
API
| Parameter | Default | Description |
|---|---|---|
|
description
|
Additional description or instructions. | |
|
name
|
files | files |
|
accept
|
audio/*,video/*,image/* | What file types to accept. Use MIME types. Example: audio/*,video/*,image/* |
|
multiple
|
false | Allow single or multiple files |
|
preview
|
false | - |
|
maxSize
|
Maximum file size allowed in MB. Number (int) in bytes or string (small, medium, large). Default is null (no limit). | |
|
uploadErrorMessage
|
Message to show when upload fails | |
|
uploadErrorMessageMinFiles
|
Message to show when minimum number of files is not met | |
|
icon
|
file_upload | @link:component/icon |
|
required
|
false | If field is required |
|
filesMax
|
1 | Maximum number of files (int). Foced to 1 if multiple is false. Default 10 for multiple. |
|
filesMin
|
0 | Minimum number of files (int). Default is 0. |
|
label
|
Label to show on the field | |
|
buttonLabel
|
Select file | What text to show on the button |
|
buttonRemoveLabel
|
Remove file | What text to show on the remove button |
|
buttonDropLabel
|
Drop files here | A label for the drop area |
|
allowedFileTypesLabel
|
Allowed files: | Label for allowed file types |
|
fileTypeVideosLabel
|
Videos | Label for video file types |
|
fileTypeImagesLabel
|
Images | Label for image file types |
|
fileTypeAudioLabel
|
Audios | Label for audio file types |
|
maximumSizeLabel
|
Maximum size | Maximum size |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-fileinput--border-radius
|
var(--border-radius) | range | - | Border Radius |
|
--c-fileinput--border-width
|
var(--border-width) | range | - | Size |
|
--c-fileinput--space
|
var(--space) | range | - | Base spacing unit. Used for padding and margin inside components. |
|
--c-fileinput--color--surface
|
var(--color--surface) | color | - | Surface |
|
--c-fileinput--color--danger
|
var(--color--danger) | color | - | Danger |
|
--c-fileinput--color--success
|
var(--color--success) | color | - | Success |
|
--c-fileinput--font-size-90
|
var(--font-size-90) | range | - | One step below base in the type scale. |
|
--c-fileinput--font-size-80
|
var(--font-size-80) | range | - | Two steps below base in the type scale. |
|
--c-fileinput--color--surface-border
|
var(--color--surface-border) | color | - | Manual companion token for borders on surface elements. |
|
--c-fileinput--shadow-color
|
var(--shadow-color) | rgba | - | Shadow Color |
|
--c-fileinput--shadow-amount
|
var(--shadow-amount) | range | - | Multiplier for elevation shadows. 0 = none, 1 = default. |
|
--c-fileinput--corner-shape
|
var(--corner-shape) | select | square, round, squircle, circular, bevel, scoop | Corner Shape |
|
--c-fileinput--color--surface-alt
|
var(--color--surface-alt) | color | - | Manual companion token for subtle surface backgrounds. |
|
--c-fileinput--color--surface-contrast-muted
|
var(--color--surface-contrast-muted) | color | - | Derived muted contrast for text and icons on surface backgrounds. |
|
--c-fileinput--color--danger-border
|
var(--color--danger-border) | color | - | Manual companion token for danger border and emphasis states. |
|
--c-fileinput--color--danger-contrast
|
var(--color--danger-contrast) | color | - | Danger Contrast |