The modal is meant to be a blocking UI element that requires user interaction to bypass. It isn't currently designed for auto-closure. For that, we have showAlert which can show a non-blocking "toast" style notification to the end user. showAlert can be configured for closure or to auto-close after a set duration.
Here is an example of how you would call that today:
```
tecton.actions.showAlert({
toastHeader: 'Verify Action',
message: 'You have 10 seconds to cancel. Would you like to continue?',
styleType: 'warning',
closable: false,
durationInMs: 10000,
clickActionName: 'CONTINUE',
hideActionName: 'CONTINUE',
hasTimestamp: true,
toastActions: [
{
label: 'Cancel',
actionName: 'CANCEL',
},
{
label: 'Continue',
actionName: 'CONTINUE',
},
],
})
.then((actionName) => {
console.log(actionName);
});
```
Another option would be to create your own overlay with a route in your application and a overpanel. With the size and height options, you can create a modal-style overpanel that gives you full control of content in the overlay and the ability to call the closeOverpanel method on a timer.
https://tecton.q2developer.com/guides/overpanel-entrypoint/
https://tecton.q2developer.com/capabilities/showOverpanel/
https://tecton.q2developer.com/capabilities/closeOverpanel/
The modal is meant to be a blocking UI element that requires user interaction to bypass. It isn't currently designed for auto-closure. For that, we have showAlert which can show a non-blocking "toast" style notification to the end user. showAlert can be configured for closure or to auto-close after a set duration.
Here is an example of how you would call that today:
```
tecton.actions.showAlert({
toastHeader: 'Verify Action',
message: 'You have 10 seconds to cancel. Would you like to continue?',
styleType: 'warning',
closable: true,
durationInMs: 10000,
clickActionName: 'CONTINUE',
hideActionName: 'CONTINUE',
hasTimestamp: true,
toastActions: [
{
label: 'Cancel',
actionName: 'CANCEL',
},
{
label: 'Continue',
actionName: 'CONTINUE',
},
],
})
.then((actionName) => {
console.log(actionName);
});
```
Another option would be to create your own overlay with a route in your application and a overpanel. With the size and height options, you can create a modal-style overpanel that gives you full control of content in the overlay and the ability to call the closeOverpanel method on a timer.
https://tecton.q2developer.com/guides/overpanel-entrypoint/
https://tecton.q2developer.com/capabilities/showOverpanel/
https://tecton.q2developer.com/capabilities/closeOverpanel/
showModal automatically close
The modal is meant to be a blocking UI element that requires user interaction to bypass. It isn't currently designed for auto-closure. For that, we have showAlert which can show a non-blocking "toast" style notification to the end user. showAlert can be configured for closure or to auto-close after a set duration.
Here is an example of how you would call that today:
```
tecton.actions.showAlert({
toastHeader: 'Verify Action',
message: 'You have 10 seconds to cancel. Would you like to continue?',
styleType: 'warning',
closable: true,
durationInMs: 10000,
clickActionName: 'CONTINUE',
hideActionName: 'CONTINUE',
hasTimestamp: true,
toastActions: [
{
label: 'Cancel',
actionName: 'CANCEL',
},
{
label: 'Continue',
actionName: 'CONTINUE',
},
],
})
.then((actionName) => {
console.log(actionName);
});
```
Another option would be to create your own overlay with a route in your application and a overpanel. With the size and height options, you can create a modal-style overpanel that gives you full control of content in the overlay and the ability to call the closeOverpanel method on a timer.
https://tecton.q2developer.com/guides/overpanel-entrypoint/
https://tecton.q2developer.com/capabilities/showOverpanel/
https://tecton.q2developer.com/capabilities/closeOverpanel/