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

Fast, concurrent, arena-based allocator with drop support

blink-alloc Blink-alloc is extremely fast allocator based on the common idea of allocating linearly zipping a cursor through memory chunk and reset ev

Tiny Discord ticket support bot that utilizes the OpenAI GPT-3.5-turbo model.
Tiny Discord ticket support bot that utilizes the OpenAI GPT-3.5-turbo model.

BDFD AI Mod Our tiny Discord ticket support bot that utilizes the OpenAI GPT-3.5-turbo model. This project aims to help users by providing a very fast

Executable memory allocator with support for dual mapping and W^X protection

jit-allocator A simple memory allocator for executable code. Use JitAllocator type to allocate/release memory and virtual_memory module functions to e

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

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

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

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

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
Meet Rustacean GPT, an experimental project transforming OpenAi's GPT into a helpful, autonomous software engineer to support senior developers and simplify coding life! 🚀🤖🧠

Rustacean GPT Welcome, fellow coding enthusiasts! ?? ?? I am excited to introduce you to Rustacean GPT, my humble yet ambitious project that aims to t

Gary McDougall 3 May 10, 2023
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