Default
SWAN's FileInput
component is built upon the native HTML <input type="file">
element, so it can accept all of the native input’s events and attributes, including onChange
to get the contents of the uploaded file, or multiple
to let the user select multiple files.
The FileInputLabel
sub-component is the visible part, since we hide the native <input>
and only show this <label>
. For accessibility, it must have accessible text, such as visible HTML text, visually-hidden text, alt text on an image, or an aria-label.
Button Variants
FileUploadLabel
is a <label>
, but it accepts many of the visual props from Button
. You can use these to customize the appearance of the label.
Available props are skin
, sizeVariant
, size
, widthVariant
, width
, specialVariant
, iconPosition
, and buttonShape
.
The preview has been updated.
Disabled
Use disabled
when a FileInput
's action is unavailable.
The preview has been updated.
Inside of a Form
Since it is a form element, FileInput
can be used inside of a StandardForm
along with a separate, external label and/or helper text.l
The preview has been updated.