Crate egui_pull_to_refresh

source ·
Expand description


egui_ver Latest version Documentation unsafe forbidden License

… adds pull to refresh functionality to egui. It works by wrapping a widget in a PullToRefresh widget, which will display a refresh indicator when the user pulls down the widget.

§Demo Videos:


use egui::{Ui};
use egui_pull_to_refresh::PullToRefresh;
// This is the minimal example. Wrap some ui in a [`PullToRefresh`] widget
// and refresh when should_refresh() returns true.
fn my_ui(ui: &mut Ui, count: u64, loading: bool) -> bool {
    let response = PullToRefresh::new(loading).ui(ui, |ui| {
        ui.add_space(ui.available_size().y / 4.0);
        ui.vertical_centered(|ui| {
            ui.label("Pull to refresh demo");

            ui.label(format!("Count: {}", count));


Have a look at the other examples for more.