Gravity
Search
K

Modal

A modal blocks all user interaction and displays a message to the user or asks for feedback using a form.
You can generate a modal anywhere in your application using the ViewContext - you don't need to import a modal component.

Preview

Code

context.modal.show({
title: 'Add User',
form: addUserForm,
buttonText: 'Send Invite',
text: 'To invite more than one user, seperate the emails with a comma',
url: '/api/user/invite',
method: 'POST'
});
// close modal
context.modal.hide();

Parameters

Param
Description
Required
Value
buttonText
submit button text
optional
string
descructive
show a red button
optional
boolean
form
optional
object
method
HTTP post type
optional
string
text
message to the user
optional
string
title
title
required
string
url
destination to send the form
optional
string
Last modified 5mo ago