Skip to content

GhostFileUpload reference ​

Package: @ghostvue/themes. Status: experimental (stability policy).

Themed wrappers around headless GhostFileUpload, GhostFileUploadDropzone, GhostFileUploadTrigger, GhostFileUploadList, and GhostFileUploadItemRemove; GhostFileUploadItem and useGhostFileUpload are re-exported unchanged. Importing from @ghostvue/themes loads ghost-file-upload.css: token-based dropzone with idle, hover, dragging, invalid, and disabled states, a neutral trigger and quiet remove buttons sized from the control scale (at least 44px on coarse pointers) with a visible focus ring, bordered list items, motion only when reduced motion is not requested, and forced-colors support. Rules key on data-themed, so headless parts stay unstyled.

Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.

All component references

Props ​

NameTypeDefaultRequiredDescription
acceptstring—NoNative `accept` grammar: a picker hint that is also enforced on intake. Forwarded to headless GhostFileUpload.
defaultValueFile[]"[]"NoUncontrolled seed and form-reset baseline, captured once at setup. Forwarded to headless GhostFileUpload.
disabledbooleanfalseNoDisables the trigger, drops, and remove buttons, and omits the mirror from submit. Forwarded to headless GhostFileUpload.
formstring—No`form` attribute for the mirror and the picker. Forwarded to headless GhostFileUpload.
idstring—NoId of the trigger (the labelable control), not of the root element. Forwarded to headless GhostFileUpload.
invalidbooleanfalseNoConsumer validity, combined with native constraint failure. Forwarded to headless GhostFileUpload.
maxFilesnumber—NoTotal list capacity. Floored; not finite or below 1 is unlimited. `1` turns `multiple` off. Forwarded to headless GhostFileUpload.
maxFileSizenumber—NoPer-file limit in bytes; equal is accepted. Not finite or negative is unset. Forwarded to headless GhostFileUpload.
messagesPartial<GhostFileUploadMessages>—NoTyped, reactive overrides of announcement and label text. Forwarded to headless GhostFileUpload.
modelValueFile[]—NoControlled list. `undefined` is uncontrolled; `[]` is a real empty value. Forwarded to headless GhostFileUpload.
namestring—NoForm mirror `name`. Without it no mirror renders and nothing is submitted. Forwarded to headless GhostFileUpload.
preventDocumentDropbooleantrueNoCancel file drags and drops outside every dropzone while an enabled dropzone is mounted. Forwarded to headless GhostFileUpload.
requiredbooleanfalseNoNative `required` on the form mirror when `name` is set. Forwarded to headless GhostFileUpload.
validateGhostFileUploadValidate—NoSynchronous, pure check after `accept` and `maxFileSize`; return a string to reject. Forwarded to headless GhostFileUpload.

Emits ​

NamePayloadDescription
rejectGhostFileUploadRejection[]Once per intake batch with at least one rejection, after update:modelValue. Fires even when a controlled parent ignores the list update.

Models ​

PropEventTypeDescription
modelValueupdate:modelValueFile[]v-model for the File[] list. Every change emits a new array with the same File instances; the consumer array is never mutated.

Slots ​

NameDescription
defaultConsumer layout of the parts, with the list entries, rejections from the latest intake, remaining capacity, effective invalid state, and actions.

Slot props: default ​

NameTypeDescription
clear() => voidEmpties the list and `rejections`, and announces it.
clearRejections() => voidEmpties `rejections` without touching the list.
entriesreadonly GhostFileUploadEntry[]Current list with stable ids for `v-for` keys.
invalidbooleanEffective invalid state: `invalid` prop or native constraint failure.
openPicker() => voidOpens the native picker. No-op when disabled.
rejectionsreadonly GhostFileUploadRejection[]Rejections from the most recent intake only.
remainingnumber | undefined`maxFiles` minus list length, never below 0; `undefined` when unlimited.
remove(file: File) => voidRemoves the first identical entry and applies the focus rule.

Exposed members ​

NameTypeDescription
blur() => voidBlurs the trigger.
clear() => voidSame as the slot `clear`.
elementHTMLElement | nullThe root element.
focus(options?: FocusOptions) => voidFocuses the trigger.
openPicker() => voidOpens the native picker; call inside a user gesture.

Parts and data attributes ​

AttributeValueDescription
data-partrootGrid stack of the consumer's parts with data-themed.
data-partdropzoneDashed surface; solid primary border while dragging.
data-parttriggerNeutral action button one medium control tall (at least 44px on coarse pointers), with a focus ring.
data-partlistUnstyled-marker grid; styles its direct item children.
data-partitemBordered row (headless part, styled through the list's child combinator).
data-partitem-removeQuiet button at the item's inline end, one small control tall (at least 44px on coarse pointers), with a focus ring.
data-statedraggingDropzone while a file drag is over it.
data-stateinvalidDanger border with doubled width on the dropzone and trigger.
data-statedisabledDisabled tokens on the trigger; reduced opacity on the dropzone.
data-themedpresentPresent on every wrapped file upload part.

CSS variables ​

NameDescription
--ghost-control-touch-minSets the dropzone's minimum block size (three touch targets tall).
--ghost-control-size-md-minMinimum block and inline size of the trigger.
--ghost-control-size-sm-minMinimum block and inline size of the remove buttons.
--ghost-border-primaryDropzone border while dragging.
--ghost-border-dangerDropzone and trigger border when invalid.
--ghost-surface-subtle-bgIdle dropzone background.
--ghost-focus-ring-colorFocus ring on the trigger and remove buttons.

Accessibility ​

Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/button/.

Required ARIA attributes: none.

Keyboard ​

None declared.

Verification ​

Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.

CategoryStatusEvidence
Automated keyboardNot reviewedNo declared key is mapped to a browser test yet.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

file-upload/asset-submission ​

Example source

Release packet assets

Add files, see rejections in the field error, recover, and check what the form submits.

Release packet assets

Attach specification PDFs or brand marks for the design review.

Drag and drop files1 of 3 slots left.
  • architecture-spec.pdf17 B
  • brand-mark.svg10 B

Not submitted yet.

file-upload/themed ​

Example source

Themed

Default theme dropzone, trigger, and removable file list with invalid and disabled states.

Drag files hereUp to 5 files.
  • q3-report.pdf17 B
  • cover-photo.png5 B