AlertDialog
確認ダイアログコンポーネント。削除などの重要な操作の確認に使用。
インポート
個別サブパス(バンドルサイズを抑えたい場合):
基本的な使い方
Loading...
ログアウト確認
Loading...
Dialogとの違い
| Dialog | AlertDialog |
|---|---|
| 一般的なモーダル | 確認・警告用 |
| 背景クリックで閉じる | 背景クリックで閉じない |
| Escapeで閉じる | Escapeで閉じない |
| 任意のコンテンツ | Cancel/Actionボタン必須 |
サイズ
size propで最大幅を調整できます(Dialogと同じ軸)。
Loading...
Props (AlertDialogContent)
| Prop | Type | Default | Description |
|---|---|---|---|
size | 'sm' | 'default' | 'lg' | 'xl' | 'full' | 'default' | ダイアログの最大幅 |
className | string | - | 追加のCSSクラス |
Props (AlertDialogAction)
| Prop | Type | Default | Description |
|---|---|---|---|
onClick | () => void | - | アクション実行時のコールバック |
className | string | - | 追加のCSSクラス |