API ReferenceDesign Systems
Material Feedback
Dialogs, snack bars, tooltips, and progress indicators.
use incular::prelude::*;
use incular::material_prelude::{
CircularProgressIndicator, LinearProgressIndicator, Tooltip,
};
fn main() {
let app = Application::new(|_cx| {
Container::builder()
.padding(EdgeInsets::all(24.0))
.alignment(Alignment::CENTER)
.child(
Column::builder()
.main_axis_size(MainAxisSize::Min)
.spacing(8.0)
.children(Vec::<Widget>::from([
LinearProgressIndicator::new().value(0.4).into(),
CircularProgressIndicator::new().size(24.0).into(),
Tooltip::new(
"Save",
Text::new("Hover me"),
).into(),
]))
.build(),
)
.build()
.into()
})
.expect("valid application");
incular::run(app).expect("run application");
}show_dialog returns a DialogHandle (open/close/dismiss);
SnackBar::text with SnackBarAction, Tooltip trigger modes and delays,
and stroke_width share the same builder shapes.
| Type | Purpose |
|---|---|
AlertDialog | Title + content + action row |
SimpleDialog / SimpleDialogOption | Option list dialog |
Dialog | Bare dialog shell with insets and shape |
DialogHandle | open / close / dismiss, barrier control |
SnackBar + SnackBarAction | Timed message with optional action |
Tooltip | Hover/focus/tap hint with delays |
LinearProgressIndicator / CircularProgressIndicator | Determinate or indeterminate progress |
SnackBarBehavior: Fixed (default) / Floating. TooltipTriggerMode:
Hover (default) / Focus / Tap / Manual.
ProgressIndicatorStrokeCap: Butt (default) / Round / Square.
Related: Toast,
Indicators.