Feedback
Two ways to tell the user something. A toast slides a short message over the content and gets out of the way on its own, so use it when nothing needs to happen next. A dialog puts a modal surface in front of the window and waits for an answer, so use it when something does. The generic dialog takes whatever content you hand it; the alert, about and preferences dialogs below are the three shapes an app asks for often enough that libadwaita writes them for you, plus the shortcuts dialog that lists your keyboard shortcuts.
A short line of text, optionally with one action button, that floats over the content for a few seconds and then dismisses itself. You do not add a toast to your layout: you wrap the page in a toast overlay and hand it toasts at runtime.
Dialog
Section titled “Dialog”The dialog the other three are built on, and the one to reach for when none of them fits: it holds whatever you give it — one child, no content model of its own — and it decides for itself whether to be a floating card over the window or a bottom sheet across it. Give it a title and a flat header with a close button appears; leave the title off and the content runs to the edges.
Alert Dialog
Section titled “Alert Dialog”Ask a question the user has to answer: a bold heading, some body text and a row of responses. Each response is a button with a string ID, and that ID is what reaches your code. Set the default and close responses so Enter and Escape do the right thing.
About Dialog
Section titled “About Dialog”Wire this to the About entry in your primary menu and you are done. Fill in the app metadata and the dialog builds the rest: a large icon, the application name, a developer line, a version pill, and Details, Credits and Legal sub-pages you never lay out yourself.
Preferences Dialog
Section titled “Preferences Dialog”The container behind your Preferences command. Organise it into pages, each holding groups of boxed-list rows. Most apps need only one page, which is what the example shows.
Shortcuts Dialog
Section titled “Shortcuts Dialog”The window behind your Keyboard Shortcuts command: sections of shortcut rows, each row a title, an optional subtitle and an accelerator drawn as keycaps. New in libadwaita 1.8.
Related
Section titled “Related”- Boxed Lists: the rows a preferences dialog is built from.
- Presentation: banners and status pages, for messages that do not interrupt.
- Layout: the header bars and toolbar views these overlays sit above.
- Adwaita Storybook: the same widgets in a live component browser you can poke at.