Skip to content

DropZone

DropZone provides a drag-and-drop target and file-picker button for adding video files. It reads canAddMore from UploadProvider context and disables itself automatically when the file limit is reached.

Drop videos here or browse
MP4, WebM, MOV — up to 500 MB
import { DropZone } from "@hyperserve/video-uploader-react";
<DropZone supportingText="MP4, WebM, MOV, up to 500 MB" />
PropTypeDefaultDescription
acceptstring"video/*"MIME type filter for the file input
multiplebooleantrueAllow multiple files
disabledbooleanfalseDisable the drop zone (also disables when canAddMore is false)
supportingTextReactNodenoneHelp text below the main label
styleCSSPropertiesnoneBase styles
activeStyleCSSPropertiesnoneMerged during drag hover
classNamestringnoneBase class
activeClassNamestringnoneAppended during drag hover
stylesDropZoneStylesnoneSlot map for default inner content (see Slots below)
childrenReactNode | ((state: DropZoneRenderProps) => ReactNode)noneReplaces the default inner content entirely (see Render function)

Pass a styles slot map to theme the default inner content without replacing it. Slots merge over defaults; the style/activeStyle props on the root container still apply on top. See Theming for the canonical merge-order explanation.

SlotTargets
rootThe outer drop-zone container (merged on top of style)
activeRootContainer styles applied during drag hover (merged on top of activeStyle)
iconThe default upload icon
primaryTextThe “Drop files here” headline
browseTextThe “browse” link inside the headline
supportingTextThe supporting text below the headline
<DropZone
styles={{
root: { background: "#0f172a", borderColor: "#334155" },
primaryText: { color: "white" },
browseText: { color: "#38bdf8" },
supportingText: { color: "#94a3b8" },
}}
supportingText="MP4, WebM, MOV, up to 500 MB"
/>

If slots aren’t enough (e.g., you want an entirely different layout), use the render function to replace the inner content wholesale.

DropZone is web-only; React Native uses the platform-native file picker instead of a drop target.

For full control over the drop zone content (replaces the default inner content entirely; slots no longer apply):

Custom drop zone UI
<DropZone>
{({ isDragging, openPicker }) => (
<div>
{isDragging ? "Release to upload" : "Custom drop zone UI"}
<button onClick={openPicker}>Select Files</button>
</div>
)}
</DropZone>
import type { DropZoneRenderProps } from "@hyperserve/video-uploader-react";
type DropZoneRenderProps = {
isDragging: boolean;
openPicker: () => void;
};

The default drop zone uses inline styles from the shared theme. Override with style/className or use the render function for complete control.