Skip to content

Feedback

Alert dialog

Asks to confirm an action that cannot be undone, before it runs.

Installation

Terminal
pnpm add @elsikora/keystone-ui-kit

Usage

Import
import { AlertDialogContent, AlertDialog, AlertDialogAction } from "@elsikora/keystone-ui-kit";
docs/alert-dialog/default.example.tsx
import {  AlertDialog,  AlertDialogAction,  AlertDialogCancel,  AlertDialogContent,  AlertDialogDescription,  AlertDialogFooter,  AlertDialogHeader,  AlertDialogTitle,  AlertDialogTrigger,  Button,} from "@elsikora/keystone-ui-kit";
export default function AlertDialogDefaultExample() {  return (    <AlertDialog>      <AlertDialogTrigger asChild>        <Button variant="destructive">Retire the release</Button>      </AlertDialogTrigger>      <AlertDialogContent>        <AlertDialogHeader>          <AlertDialogTitle>Retire release 1.1.0?</AlertDialogTitle>          <AlertDialogDescription>New rounds stop at once; open rounds finish.</AlertDialogDescription>        </AlertDialogHeader>        <AlertDialogFooter>          <AlertDialogCancel>Keep it</AlertDialogCancel>          <AlertDialogAction variant="destructive">Retire</AlertDialogAction>        </AlertDialogFooter>      </AlertDialogContent>    </AlertDialog>  );}

Examples

Default

API reference

AlertDialogContent

PropTypeDefaultDescription
containerElement | DocumentFragment | null-Where it opens; by default the nearest PortalRoot's element, else the body.

AlertDialog

PropTypeDefaultDescription
openboolean-Open, when the caller holds the state.
onOpenChange(open: boolean) => void-Called when it opens or closes.

AlertDialogAction

PropTypeDefaultDescription
variant"default" | "destructive""default"The look of the confirming button.

Notes

  • The focus moves into the dialog and starts on Cancel; Escape cancels; the focus returns to the trigger.