Add toast support in your dioxus project

Overview

dioxus-toast

Add toast support in your dioxus project.

let toast = use_ref(&cx, ToastManager::default);

cx.render(rsx! {
    dioxus_toast::ToastFrame {
        manager: toast
    }
    div {
        button {
            onclick: move |_| {
                let _id = toast.write().popup(ToastInfo::simple("Hello Dioxus"));
            },
            "Normal Toast"
        }
        button {
            onclick: move |_| {
                let _id = toast.write().popup(ToastInfo {
                    heading:Some("Success!".into()),
                    context:"Dioxus Toast".into(),
                    allow_toast_close:true,
                    position:dioxus_toast::Position::BottomLeft, 
                    icon: Some(Icon::Success), 
                    hide_after: Some(5), 
                });
            },
            "Success Toast"
        }
    }
})
You might also like...
An example project demonstrating integration with Rust for the ESP32-S2 and ESP32-C3 microcontrollers.

Rust ESP32 Example An example project demonstrating integration with Rust for the ESP32-S2 and ESP32-C3 microcontrollers.

A template for kick starting a Cloudflare worker project using workers-rs.

Getting Started A template for kick starting a Cloudflare worker project using workers-rs. This template is designed for compiling Rust to WebAssembly

Small project that try to bend to world.

Small project that try to bend to world. May not be fully working, but should provide an improvable starting point. How to The only important file is

Abstract GPU Project - The easiest and most ergonomic GPU library
Abstract GPU Project - The easiest and most ergonomic GPU library

Abstract GPU Project - The easiest and most ergonomic GPU library

A basic rp2040-hal project with blinky and rtt logging example code.

A basic rp2040-hal project with blinky and rtt logging example code. With this you can quickly get started on a new rp2040 project

A project for managing all Pop!_OS sources

Pop!_OS Pop!_OS is designed for people who use their computer to create; whether it’s complicated, professional grade software and products, sophistic

WIP demo project for pure rust playing nicely with MCUBoot/Infinitime OTA

pinetime-rust-mcuboot WIP demo project for pure rust playing nicely with MCUBoot/Infinitime OTA Firmware Behavior This is an example project so I just

The simplest way to de-Google your life and business: Inbox, Calendar, Files, Contacts & much more
The simplest way to de-Google your life and business: Inbox, Calendar, Files, Contacts & much more

Bloom The all-in-one private workspace Try it for free! You no longer trust tech monopolies with your data? You are done with your privacy invaded by

Autorebase automatically rebases all of your feature branches onto master.

Autorebase automatically rebases all of your feature branches onto master. If conflicts are found it will rebase to the last commit that doesn't cause conflicts. By default, branches with an upstream are excluded. You don't need to switch to any branch, the only limitation is that a branch that is checked out and not clean will not be rebased (though I may add that in future).

Comments
  • fix (re-render): eliminate continuous re-render

    fix (re-render): eliminate continuous re-render

    When there are no toasts, TostManager is updated every 100ms. Anyone who uses the library (which necessitates loading the ToastManager in an Element via use_atom_ref) will have their element reload on every update. This is no good. Don't do that. Instead, do the following

    refactor the ToastManager to use a Uuid for the BTreeMap - removes the need for that buggy index logic. also clean up the time calculation by refactoring ToastManagerItem to calculate hide_after using an Option

    opened by sdwoodbury 1
Owner
YuKun Liu
人间烟火气,最抚凡人心。
YuKun Liu
Create That Project. Project Creation That Rocks 🎸🧱.

Create That Project Config Example Install $ cargo install ctp Basic Info In any file or even in the commands sections of your config file you can pla

Will 5 Dec 20, 2021
Help project managers and project owners with easy-to-understand views of github issue dependencies.

Help project managers and project owners with easy-to-understand views of github issue dependencies.

nasa 56 Dec 15, 2022
A GitHub Action to automatically build and deploy your mdbook project.

?? deploy-mdbook The deploy-mdbook action allows you to easily build and deploy your mdBook project to GitHub Pages. See action.yml for configuration

null 27 Oct 24, 2022
Simple library to host lv2 plugins. Is not meant to support any kind of GUI.

lv2-host-minimal Simple library to host lv2 plugins. Is not meant to support any kind of GUI. Host fx plugins (audio in, audio out) Set parameters Hos

Cody Bloemhard 11 Aug 31, 2022
A simple entity-component-system crate for rust with serialization support

Gallium A simple entity-component-system crate for rust with serialization support Usage You can include the library using carge: [dependencies] galli

null 7 Aug 31, 2021
Serde support for (rusty_)v8

serde_v8 Serde support for (rusty_)v8 WIP: see denoland/deno#9540 TODO Experiment with KeyCache to optimize struct keys Experiment with external v8 st

Aaron O'Mullan 13 Nov 28, 2022
3MF (3D Manufacturing Format) support for Rust

3MF (3D Manufacturing Format) support for Rust About This library provides support for 3MF files to programs written in the Rust programming language.

Hanno Braun 21 Dec 17, 2022
Use enum to predicate something, support | and & operator.

Predicate Use enum to predicate something. Just need to implement Predicate Trait with predicate-macros crate, support | and & operator. Don't impleme

上铺小哥 9 Feb 8, 2022
RustSBI support on SiFive FU740 board; FU740 is a five-core heterogeneous processor with four SiFive U74 cores, and one SiFive S7 core

RustSBI 在 HiFive Unmatched 主板的支持软件 这个项目的目的是在SiFive HiFive Unmatched主板上支持RustSBI。 RustSBI是一个引导程序环境;主板上电时,RustSBI将会先行启动,而后,它将会找到一个可引导的操作系统,引导启动这个操作系统。 在

RustSBI 15 Dec 1, 2022
A (mostly) drop-in replacement for Rust's Result that provides backtrace support

Errant A (mostly) drop-in replacement for Rust's Result that provides backtrace support. Please note that Errant is still very early in development an

Joshua Barretto 17 Dec 26, 2022