> For the complete documentation index, see [llms.txt](https://docs.silkbuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.silkbuilder.com/how_to/confirm_button.md).

# Button with Confirmation

The *silk:Button* component contains the option to display a confirmation dialog window before triggering the "click" event. The user will use the dialog window to confirm the button's action. The confirmation process uses the library [sweetalert2](https://sweetalert2.github.io/) to display the dialog window with two buttons to click: one button to cancel and another to confirm. By default, the confirmation button shows the "OK" label.

The code below shows the silk tag using the confirmation properties.

```xml
<silk:Button id="bt1" label="Click me"
	confirmTitle=""
	confirmMessage=""
	confirmLabel=""
	confirmIcon=""
/>
```

It is optional to use all the properties at once; it is enough to use one property to activate the dialog windows or more properties if required.

## Properties

| Property       | Description                        | Default Value         |
| -------------- | ---------------------------------- | --------------------- |
| confirmTitle   | The confirmation's dialog title.   | The text "Continue?"  |
| confirmMessage | The confirmation's dialog message. | Empty                 |
| confirmLabel   | The confirmation's button's label. | The test "OK".        |
| confirmIcon    | The confirmation's dialog icon     | The value "question". |

## Example 1

The next is an example of setting the property confirmation's title as "Delete the client?" and leaving the other properties as default.

```xml
<silk:Button id="bt1" label="Delete"
	confirmTitle="Delete the client?"
/>
```

![Bottom dialog sample 1](https://3932510557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPkEcpm1RVG8e6cxUOo%2Fuploads%2Fgit-blob-1afa28e9460807eb53c802d12f25d98cea02305d%2Fbutton_dialog01.png?alt=media)

## Example 2

The example now adds a message to the dialog window.

```xml
<silk:Button id="bt1" label="Delete"
	confirmTitle="Delete the client?"
	confirmMessage="This operations will delete the selected client."
/>
```

![Bottom dialog sample 2](https://3932510557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPkEcpm1RVG8e6cxUOo%2Fuploads%2Fgit-blob-dfc41eea01aedd4c8d3ff0a72645fbc19352fd3e%2Fbutton_dialog02.png?alt=media)

## Example 3

This code expands to the previous example and changes the confirmation button to "Yes, delete it!".

```xml
<silk:Button id="bt1" label="Delete"
	confirmTitle="Delete the client?"
	confirmMessage="This operations will delete the selected client."
	confirmButton="Yes, delete it!"
/>
```

![Bottom dialog sample 3](https://3932510557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPkEcpm1RVG8e6cxUOo%2Fuploads%2Fgit-blob-a2dfb06f64f643c3d2ed990557b573cce89738c4%2Fbutton_dialog03.png?alt=media)

## Example 4

And finally, the default icon is changed to "info."

```xml
<silk:Button id="bt1" label="Delete"
	confirmTitle="Delete the client?"
	confirmMessage="This operations will delete the selected client."
	confirmButton="Yes, delete it!"
  confirmIcon="info"
/>
```

![Bottom dialog sample 4](https://3932510557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPkEcpm1RVG8e6cxUOo%2Fuploads%2Fgit-blob-2a13f586b0d8278e5a1864d00bc9e370c99d12df%2Fbutton_dialog04.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.silkbuilder.com/how_to/confirm_button.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
