|
| 1 | +# AlertDialog |
| 2 | + |
| 3 | +A modal dialog that interrupts the user with important content and expects a response. |
| 4 | + |
| 5 | +```twig {"preview":true} |
| 6 | +<twig:AlertDialog> |
| 7 | + <twig:AlertDialog:Trigger> |
| 8 | + <twig:Button variant="outline">Show Dialog</twig:Button> |
| 9 | + </twig:AlertDialog:Trigger> |
| 10 | + <twig:AlertDialog:Content> |
| 11 | + <twig:AlertDialog:Header> |
| 12 | + <twig:AlertDialog:Title>Are you sure?</twig:AlertDialog:Title> |
| 13 | + <twig:AlertDialog:Description> |
| 14 | + This action cannot be undone. This will permanently delete your account |
| 15 | + and remove your data from our servers. |
| 16 | + </twig:AlertDialog:Description> |
| 17 | + </twig:AlertDialog:Header> |
| 18 | + <twig:AlertDialog:Footer> |
| 19 | + <twig:AlertDialog:Cancel>Cancel</twig:AlertDialog:Cancel> |
| 20 | + <twig:AlertDialog:Action>Continue</twig:AlertDialog:Action> |
| 21 | + </twig:AlertDialog:Footer> |
| 22 | + </twig:AlertDialog:Content> |
| 23 | +</twig:AlertDialog> |
| 24 | +``` |
| 25 | + |
| 26 | +## Installation |
| 27 | + |
| 28 | +<!-- Placeholder: Installation --> |
| 29 | + |
| 30 | +## Usage |
| 31 | + |
| 32 | +<!-- Placeholder: Usage --> |
| 33 | + |
| 34 | +## Examples |
| 35 | + |
| 36 | +### Default |
| 37 | + |
| 38 | +```twig {"preview":true} |
| 39 | +<twig:AlertDialog> |
| 40 | + <twig:AlertDialog:Trigger> |
| 41 | + <twig:Button variant="outline">Show Dialog</twig:Button> |
| 42 | + </twig:AlertDialog:Trigger> |
| 43 | + <twig:AlertDialog:Content> |
| 44 | + <twig:AlertDialog:Header> |
| 45 | + <twig:AlertDialog:Title>Are you sure?</twig:AlertDialog:Title> |
| 46 | + <twig:AlertDialog:Description> |
| 47 | + This action cannot be undone. This will permanently delete your account |
| 48 | + and remove your data from our servers. |
| 49 | + </twig:AlertDialog:Description> |
| 50 | + </twig:AlertDialog:Header> |
| 51 | + <twig:AlertDialog:Footer> |
| 52 | + <twig:AlertDialog:Cancel>Cancel</twig:AlertDialog:Cancel> |
| 53 | + <twig:AlertDialog:Action>Continue</twig:AlertDialog:Action> |
| 54 | + </twig:AlertDialog:Footer> |
| 55 | + </twig:AlertDialog:Content> |
| 56 | +</twig:AlertDialog> |
| 57 | +``` |
| 58 | + |
| 59 | +### Destructive |
| 60 | + |
| 61 | +```twig {"preview":true} |
| 62 | +<twig:AlertDialog> |
| 63 | + <twig:AlertDialog:Trigger> |
| 64 | + <twig:Button variant="destructive">Delete Account</twig:Button> |
| 65 | + </twig:AlertDialog:Trigger> |
| 66 | + <twig:AlertDialog:Content> |
| 67 | + <twig:AlertDialog:Header> |
| 68 | + <twig:AlertDialog:Title>Are you absolutely sure?</twig:AlertDialog:Title> |
| 69 | + <twig:AlertDialog:Description> |
| 70 | + This action cannot be undone. This will permanently delete your account |
| 71 | + and remove your data from our servers. |
| 72 | + </twig:AlertDialog:Description> |
| 73 | + </twig:AlertDialog:Header> |
| 74 | + <twig:AlertDialog:Footer> |
| 75 | + <twig:AlertDialog:Cancel>Cancel</twig:AlertDialog:Cancel> |
| 76 | + <twig:AlertDialog:Action variant="destructive">Delete Account</twig:AlertDialog:Action> |
| 77 | + </twig:AlertDialog:Footer> |
| 78 | + </twig:AlertDialog:Content> |
| 79 | +</twig:AlertDialog> |
| 80 | +``` |
0 commit comments