Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions demos/Termina.Demo/Pages/TodoListPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions docs/components/modal-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -227,6 +249,8 @@ public class MyPage : ReactivePage<MyViewModel>
| `.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) |
Expand Down
Binary file modified docs/public/gallery/modal.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion screenshots/tapes/modal.tape
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading