Photo Upload
Evidence capture component for damage assessment photos. Supports camera capture, gallery selection, and drag-and-drop with file size validation.
Preview — Empty Upload Zone
JPEG, PNG, WebP or HEIC — max 10 MB
Optimizing your photo...
Compressing for faster upload
Photo optimized for fast upload
Tap to try again
Your photo will be stored securely and used only for damage assessment by UNDP.
Preview — Error State
JPEG, PNG, WebP or HEIC — max 10 MB
Optimizing your photo...
Compressing for faster upload
Photo optimized for fast upload
Tap to try again
Photo is too large. Maximum size is 10 MB.
Your photo will be stored securely and used only for damage assessment by UNDP.
Variants
Default (10 MB limit)
JPEG, PNG, WebP or HEIC — max 10 MB
Optimizing your photo...
Compressing for faster upload
Photo optimized for fast upload
Tap to try again
Your photo will be stored securely and used only for damage assessment by UNDP.
Custom Help Text
JPEG, PNG, WebP or HEIC — max 10 MB
Optimizing your photo...
Compressing for faster upload
Photo optimized for fast upload
Tap to try again
Upload a photo showing the current state. A reference photo will be loaded from the database.
States
| State | Description |
|---|---|
| Empty | Dashed border, camera icon, "Take a photo or choose from gallery" |
| Drag over | Border turns rapida-blue, background rapida-blue-50, text changes to "Drop your photo here" |
| Preview | Photo thumbnail with "Change" and "Remove" actions below |
| Error | Red border, error icon, error message, "Tap to try again" |
Accessibility
- The upload zone is keyboard-focusable with
tabindex="0"and activates on Enter. - Dynamic
aria-labelchanges with state: "Upload photo" vs "Photo selected. Click to change." - The hidden file input uses
aria-hidden="true"— interaction flows through the visible zone. - Uses
capture="environment"to open the rear camera on mobile devices.
Trauma-Informed Design
- Privacy notice: "Your photo will be stored securely and used only for damage assessment by UNDP."
- Large touch target (160px min-height) for field workers wearing gloves or in rain.
- Photos are optional unless explicitly marked required — never force a user to photograph trauma.
- Error messages offer immediate recovery: "Tap to try again" instead of dead-end errors.