Dialogs and Notifications
Utilize native dialogs for file selection, message boxes, and system notifications to provide a consistent and unobtrusive user experience.
Bridging Web and Desktop
Welcome to Lesson 2! In this lesson, we'll learn how to make your Electron app feel truly native by interacting with the operating system.
Desktop applications often need to ask users to select files, confirm actions, or provide timely updates. Electron provides dedicated modules for these tasks: Dialogs and Notifications.
Electron's `dialog` Module
The dialog module allows your Electron app to display native system dialogs for opening and saving files, or showing alert messages.
- Native Feel: These dialogs match the look and feel of the user's operating system (Windows, macOS, Linux).
- Blocking Interaction: Dialogs typically block the application's UI until the user interacts with them.
- Main Process Only: For security and consistency, the
dialogmodule can only be used from the main process.
All lessons in this course
- Native Menus & Context Menus
- Dialogs and Notifications
- Shell Integration
- Global Shortcuts and Clipboard Access