メインコンテンツまでスキップ
バージョン: v8

ion-toast

shadow

Properties

animated

Descriptiontrueの場合、トーストはアニメーションします。
Attributeanimated
Typeboolean
Defaulttrue

buttons

Descriptionトースト用のボタンがずらり。
Attributebuttons
Type(string | ToastButton)[] | undefined
Defaultundefined

color

Descriptionアプリケーションのカラーパレットから使用する色を指定します。デフォルトのオプションは以下の通りです。 "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", と "dark" です.色に関する詳しい情報は theming を参照してください。
Attributecolor
Type"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined
Defaultundefined

cssClass

DescriptionカスタムCSSに適用する追加のクラス。複数のクラスを指定する場合は、スペースで区切る必要があります。
Attributecss-class
Typestring | string[] | undefined
Defaultundefined

duration

Descriptionトーストを隠すまでに何ミリ秒待つかを指定します。デフォルトでは、dismiss()が呼ばれるまで表示されます。
Attributeduration
Typenumber
Defaultconfig.getNumber('toastDuration', 0)

enterAnimation

Description乾杯の音頭をとるときに使うアニメーションです。
Attributeenter-animation
Type((baseEl: any, opts?: any) => Animation) | undefined
Defaultundefined
Descriptionトーストに表示されるヘッダー。
Attributeheader
Typestring | undefined
Defaultundefined

htmlAttributes

Descriptionトーストに渡す追加の属性。
Attributehtml-attributes
Typeundefined | { [key: string]: any; }
Defaultundefined

icon

Description表示するアイコンの名前、または有効なSVGファイルへのパスを指定します。ion-icon`を参照。https://ionic.io/ionicons
Attributeicon
Typestring | undefined
Defaultundefined

isOpen

Descriptionもし true ならば、トーストは表示されます。もし false ならば、トーストは閉じます。プレゼンテーションの細かい制御が必要な場合はこれを使用し、そうでない場合は toastController または trigger プロパティを使用してください。注意: トーストが終了しても isOpen は自動的に false に戻りません。あなたのコードでそれを行う必要があります。
Attributeis-open
Typeboolean
Defaultfalse

keyboardClose

Descriptiontrueの場合、オーバーレイが表示されたときにキーボードが自動的に解除されます。
Attributekeyboard-close
Typeboolean
Defaultfalse

layout

Descriptionトーストのメッセージやボタンの配置を定義します。'baseline'を指定します。メッセージとボタンは同じ行に表示されます。メッセージテキストはメッセージコンテナ内で折り返すことができます。'stacked':ボタンコンテナとメッセージが重なるように表示されます。ボタンに長いテキストがある場合に使用します。
Attributelayout
Type"baseline" | "stacked"
Default'baseline'

leaveAnimation

Descriptionトーストの解散時に使用するアニメーションです。
Attributeleave-animation
Type((baseEl: any, opts?: any) => Animation) | undefined
Defaultundefined

message

Descriptionトーストに表示するメッセージ。このプロパティは、文字列としてカスタムHTMLを受け入れます。デフォルトではコンテンツはプレーンテキストとしてパースされます。カスタムHTMLを使用するには、Ionicの設定で innerHTMLTemplatesEnabledtrue に設定する必要があります。
Attributemessage
TypeIonicSafeString | string | undefined
Defaultundefined

mode

Descriptionmodeは、どのプラットフォームのスタイルを使用するかを決定します。
Attributemode
Type"ios" | "md"
Defaultundefined

position

Description画面上のトーストの開始位置。 positionAnchorプロパティを使ってさらに微調整できます。
Attributeposition
Type"bottom" | "middle" | "top"
Default'bottom'

positionAnchor

Descriptionトーストの位置を固定する要素。直接参照するか、要素のIDを指定します。position="bottom"の場合、トーストは選択した要素の上に表示されます。position="top"の場合、トーストは選択した要素の下に位置します。position="middle"の場合、positionAnchor`の値は無視される。
Attributeposition-anchor
TypeHTMLElement | string | undefined
Defaultundefined

swipeGesture

Descriptionvertical'に設定すると、スワイプジェスチャーでToastを消すことができます。スワイプの方向は position プロパティの値によって決まります:top:top: 上方向にスワイプすることでトーストを消すことができます。top: トーストを上方向にスワイプして消すことができます:top: 上方向にスワイプするとToastが表示され、下方向にスワイプするとToastが表示されます。middle`:トーストは上下にスワイプして消すことができます。
Attributeswipe-gesture
Type"vertical" | undefined
Defaultundefined

translucent

Descriptiontrueの場合、トーストは半透明になります。modeが "ios" で、デバイスが backdrop-filter をサポートしている場合にのみ適用されます。
Attributetranslucent
Typeboolean
Defaultfalse

trigger

Descriptionクリックされたときにトーストを開かせるトリガー要素に対応するID。
Attributetrigger
Typestring | undefined
Defaultundefined

Events

NameDescription
didDismissトーストが終了した後に発行されます。ionToastDidDismissの略記。
didPresentトーストがはじまった後に発行されます。ionToastWillDismissの略語。
ionToastDidDismissトーストが解散した後に発行されます。
ionToastDidPresentトーストが提示された後に発行されます。
ionToastWillDismiss乾杯が解散する前に発行されます。
ionToastWillPresentトーストが提示される前に発行されます。
willDismissトーストが終了する前に発行されます。ionToastWillDismissの略語です。
willPresentトーストが表示される前に発行されます。ionToastWillPresentの略記。

Methods

dismiss

DescriptionDismiss the toast overlay after it has been presented. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the remove method.
Signaturedismiss(data?: any, role?: string) => Promise<boolean>

onDidDismiss

Descriptionトーストが解散したことを解決するPromiseを返します。
SignatureonDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>

onWillDismiss

Descriptionトーストが解散するタイミングを解決するPromiseを返します。
SignatureonWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>

present

Descriptionトーストのオーバーレイを作成した後に提示します。
Signaturepresent() => Promise<void>

CSS Shadow Parts

NameDescription
buttonトーストの内側に表示される任意のボタン要素。
button cancelトーストの内側に表示される、"cancel "というロールを持つボタン要素。
containerすべての子要素を包む要素。
header乾杯のヘッダーテキストです。
iconトーストの内容の横に表示されるアイコンです。
message乾杯の音頭の本文です。

CSS Custom Properties

NameDescription
--background乾杯の背景
--background乾杯の背景
--border-colorトーストのボーダーカラー
--border-colorトーストのボーダーカラー
--border-radiusトーストのボーダー半径
--border-radiusトーストのボーダー半径
--border-styleトーストのボーダースタイル
--border-styleトーストのボーダースタイル
--border-widthトーストのボーダー幅
--border-widthトーストのボーダー幅
--box-shadow乾杯の箱影
--box-shadow乾杯の箱影
--button-colorボタンテキストの色
--button-colorボタンテキストの色
--colorトーストの文字色
--colorトーストの文字色
--end方向が左から右の場合は右から、方向が右から左の場合は左から位置すること
--end方向が左から右の場合は右から、方向が右から左の場合は左から位置すること
--heightトーストの高さ
--heightトーストの高さ
--max-heightトーストの最大の高さ
--max-heightトーストの最大の高さ
--max-widthトーストの最大幅
--max-widthトーストの最大幅
--min-heightトーストの最小の高さ
--min-heightトーストの最小の高さ
--min-widthトーストの最小幅
--min-widthトーストの最小幅
--start方向が左から右の場合は左から、方向が右から左の場合は右から位置すること
--start方向が左から右の場合は左から、方向が右から左の場合は右から位置すること
--white-space乾杯メッセージのホワイトスペース
--white-space乾杯メッセージのホワイトスペース
--widthトーストの幅
--widthトーストの幅
View Source