-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
apiIssues related to APIIssues related to APIfeature requestNew feature or improvementNew feature or improvement
Description
Describe the feature and the current behavior/state.
An API to display Alerts to the user just like the System Extensions does when rebooting the system.
Will this change the current api? How?
As this is an API feature request only additions would happen to the Raycast API.
The implementation could be based on the Toast API.
Example:
// Initialize a new Alert
const alert = new Alert({
icon: Icon.Finder,
title: 'Restart system',
message: 'Are you sure you want to restart your computer now?',
buttons: [
{
title: 'Cancel',
style: AlertButtonStyle.cancel,
action: () => {
// Perform cancel action
}
},
{
title: 'Restart',
style: AlertButtonStyle.destructive,
action: () => {
// Perform restart action
}
}
]
})
// Show Alert
await alert.show();Additionally, adding a convenience function showAlert would be beneficial as the Toast API has an equivalent with showToast
Who will benefit with this feature?
Developers could add Alerts to get the user confirmation before executing a certain function for example a destructive action like deleting an entry.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiIssues related to APIIssues related to APIfeature requestNew feature or improvementNew feature or improvement
