en un clic
rezi-modal-dialogs
// Add modal dialogs and overlay UI with focus trapping. Use when implementing confirmations, alerts, or layered interfaces.
// Add modal dialogs and overlay UI with focus trapping. Use when implementing confirmations, alerts, or layered interfaces.
Create a new screen/page for a Rezi TUI application. Use when adding views, pages, or screens to an app.
Profile and optimize Rezi app performance. Use when app feels slow, frames drop, or render phases take too long.
Add routing with guards and nested outlets to a Rezi app. Use when building multi-page/screen TUI applications.
Set up form input handling with validation and submission. Use when building forms with inputs, selects, checkboxes, etc.
Debug rendering and layout issues in Rezi apps. Use when UI looks wrong, has layout problems, or renders unexpectedly.
Add a new widget type to the Rezi framework. Use when creating new ui.* factory functions with layout, rendering, and tests.
| name | rezi-modal-dialogs |
| description | Add modal dialogs and overlay UI with focus trapping. Use when implementing confirmations, alerts, or layered interfaces. |
| user-invocable | true |
| allowed-tools | Read, Glob, Grep, Edit, Write |
| argument-hint | [modal-type] |
| metadata | {"short-description":"Add modal dialogs"} |
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.