FileButton
Open file picker with a button click
Source
LLM docs
Docs
Package
Usage
Multiple files
Set the multiple prop to allow picking multiple files:
Reset file
resetRef should be used to fix the issue with stale value on the hidden input element as input type file cannot be controlled.
Call resetRef when the user selection is cleared:
Incompatible with server components
FileButton is not compatible with React server components because it requires using function as children. To use FileButton, add "use client;" at the top of the file.