Skip to content

FileInput

The FileInput component renders Bulma’s file upload element with a CTA button and a live filename display that updates when a file is selected.

<FileInput name="avatar" label="Profile photo" />
<FileInput name="image" label="Upload image" accept="image/*" />
<FileInput name="f1" color="primary" />
<FileInput name="f2" color="info" />
<FileInput name="f3" color="success" />
<FileInput name="f4" color="warning" />
<FileInput name="f5" color="danger" />
<FileInput name="sm" size="small" />
<FileInput name="nm" />
<FileInput name="md" size="medium" />
<FileInput name="lg" size="large" />
<FileInput name="boxed" boxed color="primary" ctaLabel="Upload file" />

PDF or Word documents only. Max 2MB.

<FileInput
name="doc"
label="Supporting document"
ctaLabel="Browse…"
placeholder="No document chosen"
help="PDF or Word documents only. Max 2MB."
accept=".pdf,.doc,.docx"
/>

By default fullwidth is true. Set it to false for an inline/compact layout:

<FileInput name="compact" fullwidth={false} />
PropTypeDefaultDescription
namestringRequired. name attribute.
idstringnameid attribute; defaults to name.
labelstringLabel text rendered above the control.
acceptstringAccepted file types (e.g. "image/*").
requiredbooleanRequired field.
helpstringHelp text rendered below the control.
ctaLabelstring"Choose a file…"Text on the CTA button.
placeholderstring"No file selected"Placeholder when no file is chosen.
color"primary" | "info" | "warning" | "danger" | "success"Bulma color modifier.
size"small" | "medium" | "large"Size modifier.
fullwidthbooleantrueStretches to full container width.
boxedbooleanBoxed style variant.
classstringExtra CSS classes on the .file wrapper.