Alert ‹ Chocolat API

Alert.show(title, message, buttons)

Shows an alert.

  • title String – the title of your alert.
  • message String – the body of your alert message.
  • buttons Array – an array of buttons to display. Buttons are displayed from right to left.

Returns Number – the index of the button that was clicked. 0 is the right-most button.

Example

Alert.show("My Title", "My awesome body!", ["Yes", "No"]);