Behive Tech Registry

Confirm Dialog

v0.2.0

TODO: Add component description.

pnpm add @behivetech/molecules.confirm-dialog

Edit the code and the preview updates as you type. Every registry export is in scope — ConfirmDialog from this package, plus React hooks and every other component in the registry.

Playground
const BasicConfirmDialog = () => {
  const [open, setOpen] = useState(false);

  return (
    <>
      <button type="button" onClick={() => setOpen(true)}>
        Delete page
      </button>
      <ConfirmDialog
        open={open}
        onOpenChange={setOpen}
        title="Delete page"
        message='Are you sure you want to delete "About Us"? This cannot be undone.'
        confirmLabel="Delete"
        variant="danger"
        onConfirm={() => console.log("confirmed delete")}
      />
    </>
  );
};

render(<BasicConfirmDialog />);