glaze/oat/toast
Oat documentation: https://oat.ink/components/toast/
Programmatic toast notifications.
Anatomy
Choose a Variant, configure Options, and call
toast to trigger a notification from application code.
Recipes
import glaze/oat/toast
let options =
toast.default_options(toast.Success)
|> toast.with_placement(toast.BottomRight)
|> toast.with_duration_ms(3000)
toast.dispatch("Saved", "Your changes were stored.", options)
Types
Screen placement for a toast.
pub type Placement {
TopRight
TopLeft
TopCenter
BottomLeft
BottomRight
BottomCenter
}
Constructors
-
TopRight -
TopLeft -
TopCenter -
BottomLeft -
BottomRight -
BottomCenter
Values
pub fn default_options(variant: Variant) -> Options
Create default options for a given variant.
Defaults are top-right placement and 4000 milliseconds duration.
pub fn dispatch(
title: String,
description: String,
options: Options,
) -> Nil
Trigger a toast notification.
Available in the Browser.