Read only, with the reason in place of the button, and a refusal from the server
<div data-mount="off"></div>
API reference
FileAttach
Prop
Type
Required
Does
files
AttachedFile[]
Yes
The files already attached, in order.
label
string
The button's words. Default "Upload file".
pending
boolean
pendingLabel
string
accept
string
The input's accept list, and the limits checked before anything is sent.
maxBytes
number
maxFiles
number
The most files the list may hold; the button goes once it is full.
name
string
The file input's name, and the id of the form it posts in (its form attribute), for a form placed elsewhere on the page (forms cannot nest).
form
string
onFiles
(files: File[], input: HTMLInputElement) => void
Called with the files that pass the checks, as soon as they are chosen: the app uploads them (a fetcher submit of input.form). Without script the Upload button posts the form.
error
ReactNode
The server's answer to the last upload or remove, when it refused.
unavailable
ReactNode
Why files cannot be added here (read-only, no storage): the button gives way to these words.
renderRemove
(file: AttachedFile) => ReactNode
A file's own remove control (a confirmed post). Left out, the list cannot be changed.
emptyText
ReactNode
newTabText
string
The words for a link that opens in a new tab.
Parts and data attributes
Class
Is
.cap-attach
the root
.cap-attach-button
a part
.cap-attach-control
a part
.cap-attach-empty
a part
.cap-attach-hint
a part
.cap-attach-input
a part
.cap-attach-item
a part
.cap-attach-item-end
a part
.cap-attach-list
a part
.cap-attach-meta
a part
.cap-attach-unavailable
a part
State
Read from
:focus-visible
the platform
Accessibility
Key
Does
Tab
To the upload button, then each file's link and remove control