docs/components/input/DropZone

DropZone

Drag-and-drop file drop target.

import { DropZone } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#Props

PropTypeDefaultDescription
onDrop *(files: File[]) => voidCallback when files are dropped or selected.
acceptstring'*'Accepted MIME types or file extensions.
multiplebooleanfalseAllow multiple file selection.
maxSizenumberMaximum file size in bytes.
disabledbooleanfalseDisable drag & drop and file selection.
disableClickbooleanfalseDisable click-to-browse (the native file dialog). Drag & drop stays fully functional. Use when files are picked through another mechanism (e.g. a server-side media library) and opening the OS picker is undesirable.
childrenJSX.ElementCustom content to render instead of default UI.
idleTextstring'Drop files here or click to browse'Text shown when not dragging.
activeTextstring'Release to upload'Text shown while dragging files over the zone.
classstringAdditional CSS classes.
styleJSX.CSSPropertiesCustom styles.

* required prop.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-accent-rgb
  • --sk-bg-secondary
  • --sk-bg-tertiary
  • --sk-border
  • --sk-dropzone-bg
  • --sk-dropzone-bg-active
  • --sk-dropzone-border-color
  • --sk-dropzone-border-color-active
  • --sk-dropzone-min-height
  • --sk-dropzone-radius
  • --sk-error
  • --sk-font-size-md
  • --sk-font-size-sm
  • --sk-radius-lg
  • --sk-space-md
  • --sk-space-xl
  • --sk-text-muted