← Back to Components

File Input

Styled file uploads backed by Shiny's native upload binding.

Interactive Playground

R Code

API Reference

block_file_input()

Renders a styled file picker while preserving Shiny's native file upload data frame.

ArgumentTypeDefaultDescription
input_idcharacterrequiredInput identifier returned as input$<id>.
variant'button' | 'dropzone''button'Picker variant: styled button or drag-and-drop surface.
multiplelogicalFALSEAllow selecting multiple files.
acceptcharacterNULLAccepted MIME types or file extensions.
button_labelcharacter"Browse"Text shown inside the visible picker button.
placeholdercharacter"No file selected"Text shown before files are selected.
dropzone_labelcharacter"Drag files here or click to browse"Primary dropzone text (dropzone variant only).
dropzone_hintcharacterNULLSecondary dropzone hint text (dropzone variant only).
dropzone_iconcharacter | tagNULLIcon above the dropzone label: icon name or htmltools tag (dropzone variant only).
dropzone_contenttag | tagListNULLCustom dropzone interior; replaces the icon/label/hint stack. Mark the picker trigger with data-dropzone-trigger (dropzone variant only).
widthcharacterNULLCSS width applied to the wrapper.
disabledlogicalFALSEDisable the visible picker and native file input.
invalidlogicalFALSEApply invalid visual highlights.
stylecharacter | objectNULLInline styles applied to the visible control.
classcharacterNULLAdditional class applied to the visible control.

update_block_file_input()

Updates picker labels and states from server handlers, or clears the current selection.

ArgumentTypeDefaultDescription
sessionShinySessionrequiredActive Shiny session object.
input_idcharacterrequiredTarget file input component ID.
variant'button' | 'dropzone'NULLSwitch the picker variant.
button_labelcharacterNULLReplace the visible picker button text.
placeholdercharacterNULLReplace the empty-state placeholder text.
dropzone_labelcharacterNULLReplace the dropzone primary text.
dropzone_hintcharacterNULLReplace the dropzone hint text.
dropzone_iconcharacter | tagNULLReplace the dropzone icon (name or tag); NULL clears it.
dropzone_contenttag | tagListNULLReplace the custom dropzone interior; NULL restores the default stack.
acceptcharacterNULLReplace accepted MIME types or extensions.
multiplelogicalNULLToggle multi-file selection.
disabledlogicalNULLDisable or re-enable the picker.
invalidlogicalNULLToggle invalid visual highlights.
stylecharacter | objectNULLReplace inline styles on the visible control.
classcharacterNULLReplace classes on the visible control.
resetlogicalFALSEClear the current file selection (the value itself cannot be set from the server).