> For the complete documentation index, see [llms.txt](https://brixxbox.gitbook.io/brixxbox-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brixxbox.gitbook.io/brixxbox-documentation/client-api-reference/functions/messagebox.md).

# messageBox

Displays a modal messagebox with buttons. The function will return when a button is clicked and return the value, if set, otherwise the title of the clicked button

### Parameters

messageBoxOptions - A JSON object with messageBox parameters

### Example Usages

```javascript
  let msgBoxResult = await brixxApi.messageBox({
     title: "sampel title",
     text: "sampel text",
     buttons: [
        {
            title: "Yes",
            value: "1"
        },
        {
            title: "No",
            value: "0"
        },
        {
            title: "Cancel",
            value: "canceled"
        },
        {
            title: "Demo" // when Demo is clicked it will return "Demo" because the button does not provide a value option.
        }
  ]});
  
  console.log(msgBoxResult); //This will be either "1", "0", "canceled" or "Demo"
  if(msgBoxResult==1){
     //enter code
  }
```
