Skip to main content

Module note

Module note 

Source
Expand description

Notes: a message in sentences shown inside a page, a form or a panel (an error, a warning, a success, a piece of information), where a badge (Indicator) is too small for it.

A note has a severity, shown by a symbol from the icon registry whose tooltip and accessible name say the severity in words; a headline in plain words; an optional reason, hint and technical details (folded, closed at first); its actions; and a Copy button that copies all of it with the time the note was first shown. Every text wraps to the width it is given and can be selected.

For screen readers, a note is a group with the Alert role (an error or a warning) or the Status role (otherwise), holding its text, and it is announced (a11y::announce) when it appears or its text changes: at once for an error, when the reader is idle otherwise.

use egui_pop_core::note::{Note, Severity};

let note = Note::error("cloudy was not added")
    .reason("The network found no route to it.")
    .hint("Check that cloudy is on and on the same network.")
    .details("cannot enrol with cloudy: connect: No route to host (os error 113)")
    .time("2026-12-01 10:42:03 UTC");
assert_eq!(note.severity, Severity::Error);
assert_eq!(
    note.copy_text(),
    "cloudy was not added\n\nThe network found no route to it.\n\n\
     Check that cloudy is on and on the same network.\n\n---\n\
     cannot enrol with cloudy: connect: No route to host (os error 113)\n\
     time: 2026-12-01 10:42:03 UTC"
);

A compact note (Note::compact) is one line of text after its symbol, wrapped and selectable, with no frame, no Copy button and no announcement: a toned title in a list, a reason beside a button.

Experimental: may change in any release (docs/stability.md).

Structs§

Note
An inline message in sentences: see the module.
NoteResponse
What happened to a note this pass.

Enums§

Severity
How serious a note is: its symbol, its colour, its role for screen readers and how urgently it is announced.