Dropzone & Card Grid
The dropzone layout of UploadType: drop, paste, or click to browse. Without previews, files line up under
the target. With show_preview, each image becomes a card in a responsive grid.
A large drop target
layout: dropzone turns the field into a target for dropped or pasted files.
Clicking it still opens the file picker.
With multiple, each file transfers on its own and shows its status under the
target.
26$builder->add('documents', UploadType::class, [
27 'uploader' => 'documents',
28 'layout' => 'dropzone',
29 'multiple' => true,
30 'max_files' => 3,
31]);
Cards, not rows
Add show_preview and the dropzone lays images out as a responsive grid of
cards. Once a file is there, the drop target becomes the last card.
The grid ships with the dropzone styles. This page restyles it with CSS only: the custom properties below, and a few site rules for the spacing and the round remove button.
26$builder->add('photos', UploadType::class, [
27 'uploader' => 'gallery',
28 'layout' => 'dropzone',
29 'multiple' => true,
30 'max_files' => 8,
31 'show_preview' => true,
32]);
Make it yours with CSS variables
Every color, radius, and spacing of the field reads from a --ux-upload-*
custom property. Set them on a container: no markup change, no form theme.
For deeper changes, override the ux_upload_item or ux_upload_picker form
theme blocks, as the Simple variant does on the input demo.
.FieldStyle--grid .ux-upload {
--ux-upload-accent: #7c3aed;
--ux-upload-accent-strong: #6d28d9;
--ux-upload-radius: 1rem;
--ux-upload-gap: 1rem;
}