能否在Gmail Add-on中实现类Spreadsheets Add-on的模态对话框?
Hey there, let’s break this down clearly for you:
- Direct answer: Unfortunately, right now Gmail Add-ons do not support modal dialogs of the same type you can use in Google Sheets (or Docs/Slides) Add-ons.
- Your initial observation is spot-on: The only official way to present custom UI to users in Gmail Add-ons is via Cards built with the Card Service. These are embedded directly within Gmail's interface (typically the right-hand sidebar) and adhere to Gmail's specific UI patterns.
I’ve dug through Google’s official documentation and developer communities extensively, and there’s no mention of modal dialog support for Gmail Add-ons—neither explicit confirmation that it’s unavailable, nor any working implementation examples. The Card Service is the sole supported framework for building interactive UI in Gmail Add-ons, and it doesn’t include components for creating modal overlays.
If you’re looking for a more focused, interactive experience, you’ll have to work within the Card Service’s capabilities: you can build multi-step card workflows, add form inputs, or even link out to external web tools (though that takes users away from the Gmail context). But full-screen modal dialogs that block interaction with the rest of Gmail aren’t currently achievable.
内容的提问来源于stack exchange,提问作者vzhemevko




