Search code examples
androiduser-interfaceandroid-alertdialoghuman-computer-interface

When should I use a title in an AlertDialog?


From a user-interface perspective, why is there a title option to an AlertDialog? Why doesn't the message alone suffice? Do we really need a title? If so, please provide visual examples of where a title would be useful.

The AlertDialog documentation shows an AlertDialog without a title, and it looks perfect to me:

AlertDialog without title


Solution

  • The Android Design guide on Alerts says:

    Alerts

    Alerts inform the user about a situation that requires their confirmation or acknowledgement before proceeding. They differ slightly in appearance based upon the severity and impact of the message conveyed.

    Alerts without title bars

    Most alerts don't need titles. Usually the decision doesn't have a severe impact and can be summed up succinctly in a sentence or two. The content area should either ask a question (such as "Delete this conversation?") or make a clear statement whose relationship to the action buttons is obvious.

    Dialog with no title

    Alerts with title bars

    Keep the question or statement short: for example, "Erase USB storage?" Avoid apologies. A user should be able to skip the content completely and still have a clear idea of what choices are available based on the title and the text of the action buttons.

    Dialog with title

    When crafting a confirmation dialog, make the title meaningful by echoing the requested action.

    Don't:

    • Are you sure?
    • Don't
    • Warning!

    Do:

    • Erase USB storage?