# Popup Form

## Overview

A popup form is a type of form that appears as a small overlay on top of the content triggered by a user action such as clicking a button.

<figure><img src="/files/I7bStmUP9Vw8GhBgzrcc" alt=""><figcaption></figcaption></figure>

### Properties

<table><thead><tr><th width="141.4921875">Name</th><th width="115.83203125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td>Component name</td></tr><tr><td><code>value</code></td><td><code>object</code></td><td>Key value object</td></tr><tr><td><code>valid</code></td><td><code>boolean</code></td><td>Indicates if the component is valid</td></tr><tr><td><code>validating</code></td><td><code>boolean</code></td><td>Indicates if the component is validating</td></tr></tbody></table>

### Methods

<table><thead><tr><th width="222.11328125">Name</th><th width="151.1484375">Parameters</th><th width="103.84765625">Returns</th><th>Description</th></tr></thead><tbody><tr><td><code>open</code></td><td>–</td><td><code>void</code></td><td>Open modal window</td></tr><tr><td><code>close</code></td><td>–</td><td><code>void</code></td><td>Close modal window</td></tr><tr><td><code>setValue</code></td><td><code>data: object</code></td><td><code>void</code></td><td>Set component data. Data is an object with arbitrary structure. </td></tr><tr><td><code>setSubmitButtonDisabled</code></td><td><p><code>disabled:</code> <br><br></p><p><code>boolean</code></p></td><td><code>void</code></td><td>Disable or enable the submit button</td></tr><tr><td><code>reset</code></td><td>–</td><td><code>void</code></td><td>Reset component to the initial value</td></tr><tr><td><code>validate</code></td><td>–</td><td><code>void</code></td><td>Trigger form validation</td></tr><tr><td><code>resetValidation</code></td><td>–</td><td><code>void</code></td><td>Clear validation errors</td></tr><tr><td><code>setErrors</code></td><td><p><code>errors: {</code> </p><p><code>[key: string]:</code> </p><p><code>string } | null</code></p></td><td><code>void</code></td><td>Mark the component as invalid and display errors</td></tr><tr><td><code>setOpenButtonDisabled</code></td><td><p><code>disabled:</code> </p><p><code>boolean</code></p></td><td><code>void</code></td><td>Disable or enable the open button</td></tr><tr><td><code>submit</code></td><td>–</td><td><code>void</code></td><td>Trigger submit event</td></tr></tbody></table>

### Triggers

<table><thead><tr><th width="214.3671875">Name</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>On Init</strong></td><td>Triggered when the component is initialized</td><td></td></tr><tr><td><strong>On Submit</strong></td><td>Triggered when the component data is submitted</td><td></td></tr><tr><td><strong>On Click</strong></td><td>Triggered when the component is clicked</td><td></td></tr><tr><td><strong>On Double Click</strong></td><td>Triggered when the component is double-clicked</td><td></td></tr><tr><td><strong>On Change</strong></td><td>Triggered when the component's state changes</td><td></td></tr><tr><td><strong>On Custom Button Click</strong></td><td>Triggered when the custom button is clicked</td><td></td></tr><tr><td><strong>On Custom Button Double Click</strong></td><td>Triggered when the custom button is double-clicked</td><td></td></tr><tr><td><strong>On Open</strong></td><td>Triggered when the component is opened</td><td></td></tr><tr><td><strong>On Close</strong></td><td>Triggered when the component is closed</td><td></td></tr></tbody></table>

## Working with the component

You can cuztomize the component using its settings in the right side panel. From there, you can, for example:

* *Hide the component*

If necessary, you can hide the popup button to save space and open or close the form programmatically by selecting the **Hide button** checkbox.

<figure><img src="/files/8ABtww0y37QEoSPt7DdA" alt=""><figcaption></figcaption></figure>

* *Add a custom button to the form*

By default, the component contains only a single *Submit* button. But you can also add a custom button to the form and customize it using the **Show custom button** setting.

<figure><img src="/files/2hyVRuIo2LJNfP0jynDu" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The Popup Form also supports [CSS styling](/how-tos/styling/modify-components-with-css.md).
{% endhint %}

* *Reset the form on close*

By default, the component resets its content on submission but retains it if the form is closed. But, if required, you can modify this behaviour using the **Reset on close** setting.

<figure><img src="/files/zYRzmMU5cj59J3P01ovh" alt=""><figcaption></figcaption></figure>


---

# 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.uibakery.io/reference/working-with-components/pop-up-form.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.
