AlertDialog

安装

npx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/alert-dialog.json
yarn dlx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/alert-dialog.json
pnpx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/alert-dialog.json
bunx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/alert-dialog.json

参考

示例

import {AlertDialog,AlertDialogAction,AlertDialogCancel,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,AlertDialogTitle,AlertDialogTrigger,} from "@/registry/ssp/ui/alert-dialog"import { Button } from "@/registry/ssp/ui/button"export default function Example() {return (  <AlertDialog>    <AlertDialogTrigger asChild>      <Button variant='outline'>Show Dialog</Button>    </AlertDialogTrigger>    <AlertDialogContent>      <AlertDialogHeader>        <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>        <AlertDialogCancel>Cancel</AlertDialogCancel>        <AlertDialogAction>Continue</AlertDialogAction>      </AlertDialogFooter>    </AlertDialogContent>  </AlertDialog>)}