.codex/skills/rezi-modal-dialogs/SKILL.md
Add modal dialogs and overlay UI with focus trapping. Use when implementing confirmations, alerts, or layered interfaces.
npx skillsauth add rtlzeromemory/rezi rezi-modal-dialogsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when:
packages/core/src/widgets/useModalStack.ts — useModalStack() hookpackages/core/src/widgets/types.ts — ModalProps, LayersPropspackages/core/src/widgets/ui.ts — ui.modal(), ui.layers()packages/core/src/ui/recipes.ts — recipe.modal() and recipe.surface() for design-system-consistent modal stylinguseModalStack() inside a defineWidget:
const modals = useModalStack(ctx);
// Push a modal
modals.push("confirm", {
title: "Confirm",
content: body,
onClose: () => modals.pop(),
});
// Include in view
return ui.layers([mainContent, ...modals.render()]);
Use ui.modal() directly with a state-controlled flag:
return ui.layers([
mainContent,
...(state.showModal
? [
ui.modal({
id: "confirm-modal",
title: "Confirm",
initialFocus: "confirm-ok",
returnFocusTo: "open-confirm",
onClose: () => app.update((s) => ({ ...s, showModal: false })),
content: ui.text("Are you sure?"),
actions: [
ui.button({
id: "confirm-cancel",
label: "Cancel",
intent: "secondary",
onPress: () => app.update((s) => ({ ...s, showModal: false })),
}),
ui.button({
id: "confirm-ok",
label: "OK",
intent: "primary",
onPress: () => app.update((s) => ({ ...s, showModal: false })),
}),
],
}),
]
: []),
]);
Overlay ordering note:
ui.layers([...]) as the common overlay composition root.Dialog action intent note:
intent to communicate action semantics in modal/dialog button rows.primary, cancel/back -> secondary, destructive -> danger, positive approval -> success, cautionary acknowledgment -> warning.testing
Write tests for Rezi widgets, screens, or app logic using createTestRenderer and node:test.
development
Add routing with guards and nested outlets to a Rezi app. Use when building multi-page/screen TUI applications.
tools
Profile and optimize Rezi app performance. Use when app feels slow, frames drop, or render phases take too long.
tools
Set up keyboard shortcuts and chord bindings for a Rezi app. Use when adding hotkeys, key combos, or modal input modes.