Skip to content

PUIToast

Elijah Cobb edited this page May 13, 2021 · 3 revisions

A toast is a small pop-up that displays information to the user. Supply a message and type using the PUIHookToast hook. If you supply a duration the toast will leave the screen after the specified amount of seconds. If you don't supply a duration, the toast will stay on the screen for 6 seconds.

import {PUIStatus, usePUIToast} from "./pstdl-ui";
import {ReactElement} from "react";

export function TestBed(): ReactElement {

	const toast = usePUIToast();

	return <div className={"TestBed"}>
		<button onClick={() => {
			toast({msg: "Hello, pstdl-ui!", type: PUIStatus.SUCCESS, duration: 3})
		}}>Show Toast!</button>
	</div>
	
}

image-20210513191349605

Clone this wiki locally