diff --git a/demos/Termina.Demo/Pages/TodoListPage.cs b/demos/Termina.Demo/Pages/TodoListPage.cs index 62447683..6a67c6fa 100644 --- a/demos/Termina.Demo/Pages/TodoListPage.cs +++ b/demos/Termina.Demo/Pages/TodoListPage.cs @@ -110,6 +110,9 @@ public override ILayoutNode BuildLayout() _addModal = Layouts.Modal() .WithTitle("Add New Task") + .WithTitleColor(Color.Cyan) + .WithFooter("Enter: Add | Esc: Cancel") + .WithFooterColor(Color.Gray) .WithBorder(BorderStyle.Rounded) .WithBorderColor(Color.Cyan) .WithBackdrop(BackdropStyle.Dim) @@ -120,6 +123,9 @@ public override ILayoutNode BuildLayout() _priorityModal = Layouts.Modal() .WithTitle("Select Priority") + .WithTitleColor(Color.Yellow) + .WithFooter("Enter: Select | Esc: Cancel") + .WithFooterColor(Color.Gray) .WithBorder(BorderStyle.Rounded) .WithBorderColor(Color.Yellow) .WithBackdrop(BackdropStyle.Dim) diff --git a/docs/components/modal-node.md b/docs/components/modal-node.md index 0e7d3fcb..bad7129b 100644 --- a/docs/components/modal-node.md +++ b/docs/components/modal-node.md @@ -82,6 +82,28 @@ Layouts.Modal() .WithContent(content) ``` +## Footer + +The modal footer renders on the bottom border line — ideal for keyboard hints, status text, or context info without consuming content area space: + +```csharp +var modal = Layouts.Modal() + .WithTitle("Add New Task") + .WithTitleColor(Color.Cyan) + .WithFooter("Enter: Add | Esc: Cancel") + .WithFooterColor(Color.Gray) + .WithBorder(BorderStyle.Rounded) + .WithBorderColor(Color.Cyan) + .WithBackdrop(BackdropStyle.Dim) + .WithContent(textInput); + +// ╭─ Add New Task ───────────────────────────────────╮ +// │ │ +// │ Enter task description... │ +// │ │ +// ╰─ Enter: Add | Esc: Cancel ───────────────────────╯ +``` + ## With Interactive Content Modals forward keyboard input to focusable content like TextInputNode or SelectionListNode: @@ -227,6 +249,8 @@ public class MyPage : ReactivePage | `.WithTitleColor(Color)` | Set title color | | `.WithBorder(BorderStyle)` | Set border style | | `.WithBorderColor(Color)` | Set border color | +| `.WithFooter(string)` | Set footer text (rendered on bottom border line) | +| `.WithFooterColor(Color)` | Set footer text color | | `.WithBackdrop(BackdropStyle)` | Set backdrop style | | `.WithBackdropColor(Color)` | Set backdrop color | | `.WithBackdropChar(char)` | Set backdrop character (Dim style) | diff --git a/docs/public/gallery/modal.gif b/docs/public/gallery/modal.gif index 8f78228b..e0023096 100644 Binary files a/docs/public/gallery/modal.gif and b/docs/public/gallery/modal.gif differ diff --git a/screenshots/tapes/modal.tape b/screenshots/tapes/modal.tape index 743b733a..01e707c3 100644 --- a/screenshots/tapes/modal.tape +++ b/screenshots/tapes/modal.tape @@ -17,7 +17,7 @@ Type "a" Sleep 1200ms Show -# Frame 1: the "Add New Task" modal over a dimmed backdrop. +# Frame 1: the "Add New Task" modal with footer visible. Sleep 1500ms Type "Deploy release to production" Sleep 1500ms