Skip to content

Toast

概要

ToastcreateToaster() で管理オブジェクトを作成し、Toast.Toaster で描画する命令的トースト通知システムです。現在の API は Toast.show() ではなく、toaster.success()toaster.create() を使います。

TIP

旧 Promise ベース API(ToastClassic)はレガシー扱いです。このページでは current API を案内します。

Usage 使用例

基本

createToaster() でトースターを作成し、Toast.Toaster を 1 つ配置して使います。

API Reference

createToaster Options

PropsTypeDefaultDescription
placement"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end""bottom-end"表示位置です
durationnumber5000自動消去までのミリ秒です。0 で無期限表示します
maxnumber24同時表示の最大件数です
removeDelaynumber200閉じアニメーション後に DOM から除去するまでの猶予です
pauseOnHoverbooleantrueホバー中にタイマーを一時停止します

Toaster Methods

MethodDescription
create(options)任意タイプのトーストを作成します
success(options)成功トーストを作成します
error(options)エラートーストを作成します
warning(options)警告トーストを作成します
info(options)情報トーストを作成します
loading(options)ローディングトーストを作成します
dismiss(id)指定 ID のトーストを閉じます
dismissAll()すべてのトーストを閉じます
update(id, options)既存トーストの内容を更新します

Toast Subcomponents

ComponentDescription
Toast.Root単一トーストのルートです
Toast.Indicatorタイプアイコンです
Toast.Titleタイトル表示です
Toast.Description本文表示です
Toast.ActionTriggerアクションボタンです
Toast.CloseTrigger閉じるボタンです
Toast.ToastercreateToaster の状態を描画する固定位置コンテナです

Mithril UI Kit Documentation