# Setup

After you've [installed Dropzone](/getting-started/installation.md) there are two ways to setup Dropzone. The easiest way is to let Dropzone auto discover your forms, and attach the drag and drop events automatically. For that, you simply need to provide a class to your form. This is called the **declarative** setup.

{% content-ref url="/pages/-MOvb9N5cMt-2OZ3O0U5" %}
[Declarative](/getting-started/setup/declarative.md)
{% endcontent-ref %}

If you have a more complex use case, or you'd like to control *when* the Dropzone object is created and listens to events, you can instantiate the Dropzone yourself. This is called the **imperative** setup.

{% content-ref url="/pages/-MOvuFkyOZDEavDwLTRG" %}
[Imperative](/getting-started/setup/imperative.md)
{% endcontent-ref %}

### Which approach is better?

There is not one approach that is better than the other. I would say that if you use a package manager, it's likely you'll prefer the **imperative** approach, but the **declarative** approach is generally a bit simpler.

Choose the **declarative** approach when...

* ...you're not used to writing JavaScript code
* ...your configuration is very simple or you're happy with the defaults

Choose the **imperative** approach when...

* ...you're writing a web app, and your routes need to create the Dropzone after loading the page
* ...you only want to create a Dropzone after specific events (for example if the user expanded a section)
* ...the configuration of your Dropzone depends on some additional context (for example if you want to send the files to a different URL on some other condition)
* ...you simply prefer the imperative way.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dropzone.dev/getting-started/setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
