Skip to content

Toast ​

An opinionated toast. Bottom-right on wide windows, bottom-centre on compact ones. Swipe sideways to dismiss; touches outside the toasts go straight to the page.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Duration ​

Each toast auto-dismisses after its duration (default 4 s). Pass duration: 0 to keep it until it is swiped away or dismissed; SparkToast.configure() sets the defaults.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SToastSlot ​

Content of one toast layer: resolves its item from the layer's context and draws the card at the toaster width (full width minus margins on compact windows, 356vp otherwise).

No props.

MIT Licensed