alert-dialog

Basic alert dialog with title, description, and action buttons

Basic alert dialog with title, description, and action buttons

Загрузка превью…

src/alert-dialog/c-alert-dialog-1.vue

<script setup lang="ts">
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"
import { Button } from "@/components/ui/button"
</script>

<template>
  <AlertDialog>
    <AlertDialogTrigger as-child>
      <Button variant="outline">Open Alert Dialog</Button>
    </AlertDialogTrigger>
    <AlertDialogContent class="sm:max-w-sm">
      <AlertDialogHeader class="sm:place-items-center sm:text-center">
        <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
        <AlertDialogDescription>
          This action cannot be undone. This will permanently delete your account and remove your data from our
          servers.
        </AlertDialogDescription>
      </AlertDialogHeader>
      <AlertDialogFooter class="sm:justify-center">
        <AlertDialogCancel>Cancel</AlertDialogCancel>
        <AlertDialogAction>Continue</AlertDialogAction>
      </AlertDialogFooter>
    </AlertDialogContent>
  </AlertDialog>
</template>

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-alert-dialog-1.json

Зависимости реестра

Источник: порт из ReUI (Keenthemes, MIT)