# Helpers.createDropZone()

```ts
createDropZone(container: HTMLElement, options: DropZoneOptions): DropZone
```

The viewer before a document. A host mounts the viewer and, until a file arrives, has nothing to show but a blank box; this is that box — a drop target, a file picker, and the privacy line.

- Kind: static method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `container` | `HTMLElement` | Where the box is mounted — the element the viewer will later use. |
| `options` | `DropZoneOptions` | `{ onFile, onReject?, title?, note?, action?, locale?, icons? }`. `onFile(file)` receives a dropped or chosen PDF; `onReject(file)` a file that is not a PDF. `title`, `note` and `action` are the words shown; `locale` is the viewer's [locale](https://kernstra.com/docs/web-sdk/config/locale) and `icons` its [toolbar.icons](https://kernstra.com/docs/web-sdk/config/toolbar/icons). |

Returns `DropZone`: `{ element, open(), destroy() }` — `open()` opens the file picker, for a host shortcut such as Ctrl+O; `destroy()` once a document is open.

```ts
const zone = createDropZone(container, { onFile: (file) => void openPdf(file) });
window.addEventListener('keydown', (e) => {
  if ((e.metaKey || e.ctrlKey) && e.key === 'o') zone.open();
});
```

Part of [Helpers](https://kernstra.com/docs/web-sdk/api/helpers) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/helpers/createdropzone
