Skip to content

Dialog / modal

In review
Live · web

Variant: pick one, then open the dialog

Last outcome: none yet. Esc, Cancel, the scrim, or the close button dismisses; Enter / the default action resolves. The island is live.

// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform;
// this is the canonical API the published @dizyx/nockerl-react package exposes.)
// NockerlDialog composes the shipped NockerlOverlay primitive (scrim + focus-trap + Esc);
// it supplies the centered card, the scale-in motion, and the Enter=confirm shortcut.
import { NockerlDialog } from '@dizyx/nockerl-react';
export function DeleteSessionDialog({ open, name, stage, onCancel, onDelete }: Props) {
return (
<NockerlDialog
open={open}
stage={stage}
title="Delete session?"
tone="destructive"
icon="warning"
confirmLabel="Delete"
onConfirm={onDelete}
onDismiss={onCancel}
>
<p>{name}” will be permanently removed.</p>
<p className="muted">Chat history is preserved on the server.</p>
</NockerlDialog>
);
}
PropTypeDefaultDescription
open *booleanWhether the dialog is presented.
onDismiss *() => voidDismiss handler: scrim tap, Esc, Cancel, or the close (X) button.
onConfirm *() => voidDefault-action handler: the confirm button + Enter.
title *stringAccessible title; carries the dialog name (aria-labelledby).
confirmLabelstring'Confirm'Confirm-button label.
cancelLabelstring | null'Cancel'Cancel-button label. null hides Cancel (a single-action alert).
tone'primary' | 'destructive''primary'Emphasis of the default action: primary cyan or destructive red.
icon'warning' | 'fork'Optional leading header glyph key (warning for destructive, fork for branch).
confirmDisabledbooleanfalseDisable the confirm action (e.g. an unsatisfied form).
stage *HTMLElement | nullThe contained stage element, which gates rendering so the dialog never escapes it.
children *React.ReactNodeBody: supporting text and/or a form field.