The modal windows on our site have a Close button (X) in the upper right corner, and for years that's been the only way to close them. I just added the ability to close modals by pressing the Esc key. I want to let our longterm users (and our new users, too) know that this functionality is available. Is there a good / standard way to show that hint? Maybe as a title on the Close button? Are there any examples of where this is done well?

2 Answers 2


enter image description here

Try adding a tooltip, with info about the shortcut key, to the Close button (x).

Users will have to discover this -- but it's a one-time learn.

  • 1
    I think I am going to give this a try.
    – andi
    Apr 20, 2018 at 19:28
  • A tooltip is probably the most useless thing possible, you'd have to have the mouse above the button, just a short click away, why bother with the esc then. The esc key is useful mostly to keyboard and assistive technology users, who don't rely on a mouse, so it would have to be somehow displayed right away.
    – lucian
    Apr 17, 2023 at 22:53

I would add in the functionality and let users find it organically. You could add a tooltip, since it's a one-time learn, but unless you have many modals that a user has to navigate through on a regular basis, learning to close with esc instead of a click isn't a big win and almost results in a wash.

  • we do have a ton of modals used on a regular basis.
    – andi
    Apr 19, 2018 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.