Incular logoIncular
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.

TypePurpose
AlertDialogTitle + content + action row
SimpleDialog / SimpleDialogOptionOption list dialog
DialogBare dialog shell with insets and shape
DialogHandleopen / close / dismiss, barrier control
SnackBar + SnackBarActionTimed message with optional action
TooltipHover/focus/tap hint with delays
LinearProgressIndicator / CircularProgressIndicatorDeterminate or indeterminate progress

SnackBarBehavior: Fixed (default) / Floating. TooltipTriggerMode: Hover (default) / Focus / Tap / Manual. ProgressIndicatorStrokeCap: Butt (default) / Round / Square.

Related: Toast, Indicators.