Documentation / @zerotal/flow / index / FlashBuilder
Interface: FlashBuilder
Defined in: flow/src/Component.ts:209
Fluent toast builder returned by this.flash(...). Each setter mutates the
queued flash in place and returns the builder, so calls chain:
Example
this.flash("Post deleted")
.title("Removed")
.warning()
.position("top-center")
.duration(8000)
.progressBar();
Methods
level()
level(
level):this
Defined in: flow/src/Component.ts:211
Set the status level explicitly.
Parameters
level
"error" | "success" | "warning" | "info"
Returns
this
success()
success():
this
Defined in: flow/src/Component.ts:212
Returns
this
error()
error():
this
Defined in: flow/src/Component.ts:213
Returns
this
warning()
warning():
this
Defined in: flow/src/Component.ts:214
Returns
this
info()
info():
this
Defined in: flow/src/Component.ts:215
Returns
this
title()
title(
title):this
Defined in: flow/src/Component.ts:217
Bold header above the message.
Parameters
title
string
Returns
this
position()
position(
position):this
Defined in: flow/src/Component.ts:219
Anchor this toast at a screen corner (overrides the <Flash> default).
Parameters
position
Returns
this
duration()
duration(
ms):this
Defined in: flow/src/Component.ts:221
Auto-dismiss after ms. Pass 0 to keep it until the user dismisses it.
Parameters
ms
number
Returns
this
noAutoDismiss()
noAutoDismiss():
this
Defined in: flow/src/Component.ts:223
Keep the toast until dismissed (equivalent to duration(0)).
Returns
this
dismissible()
dismissible(
value?):this
Defined in: flow/src/Component.ts:225
Show/hide the close (×) button. Defaults to true.
Parameters
value?
boolean
Returns
this
icon()
icon(
icon):this
Defined in: flow/src/Component.ts:227
Override the status icon with emoji/text, or pass false to hide it.
Parameters
icon
string | false
Returns
this
progressBar()
progressBar(
value?):this
Defined in: flow/src/Component.ts:229
Show a countdown progress bar. Defaults to true.
Parameters
value?
boolean
Returns
this
action()
action(
label,method,args?,style?):this
Defined in: flow/src/Component.ts:240
Add an action button that invokes a @expose method on click (then dismisses).
Call it more than once to render multiple buttons. method is the method name;
args are forwarded to it; style is a color shorthand or a FlashActionStyle.
Parameters
label
string
method
string
args?
unknown[]
style?
string | FlashActionStyle
Returns
this
Example
this.flash("Post deleted")
.action("Undo", "restorePost", [postId], "info")
.action("Delete forever", "purge", [postId], { color: "error", variant: "solid", uppercase: true });
onClose()
onClose(
method,args?):this
Defined in: flow/src/Component.ts:246
Invoke a @expose method when the toast is dismissed (timeout, ×, or action).
Parameters
method
string
args?
unknown[]
Returns
this
Example
this.flash("Heads up").noAutoDismiss().onClose("acknowledge");