noora-interactive-tables
Noora Interactive Tables
Use this skill when a Swift CLI needs table-based navigation rather than simple printed rows.
Selectable Table
import Noora
let rows = [
["init", "Create a new project", "Stable"],
["deploy", "Ship to production", "Preview"],
["doctor", "Run environment checks", "Stable"],
]
let selectedIndex = try await Noora().selectableTable(
headers: ["Command", "Description", "State"],
rows: rows,
pageSize: 5
)
Paginated Table
try Noora().paginatedTable(
headers: ["Build", "Status", "Runner", "Date"],
rows: releaseRows,
pageSize: 10
)
Lazy Paginated Table
Use the async loadPage variant when pages come from an API or another deferred source.
try await Noora().paginatedTable(
headers: ["ID", "User", "Status"],
pageSize: 10,
totalPages: 8,
loadPage: { page in
try await fetchRows(page: page)
}
)
Updating Tables
Use AsyncSequence updates when rows change over time.
await Noora().table(initialTableData, updates: updates)
let selected = try await Noora().selectableTable(
initialTableData,
updates: updates,
pageSize: 8
)
Guidance
- Interactive tables require an interactive terminal. Plan for
NooraError.nonInteractiveTerminal. - Use
pageSizethat fits normal terminal heights. - For updating tables, keep row identity stable enough that users can track changes.
- For lazy pagination, keep page fetch latency visible and expected.
Avoid
- Using interactive tables in CI or piped output without a fallback.
- Sending wildly reshuffled rows every update so selection becomes meaningless.
- Using a table when a choice prompt would be simpler.
More from spqw/skills-noora
noora-alerts
Use when building Noora warning, success, error, or info alerts in a Swift CLI. Covers choosing alert type, structuring takeaways, and using `TerminalText` interpolation inside alert copy.
1noora-progress-step
Use when a Swift CLI needs a spinner-style Noora progress step for an async operation. Covers `progressStep`, optional status updates, success and error messages, and sequencing multiple steps.
1noora-text-formatting
Use when composing or formatting Noora `TerminalText` in a Swift CLI. Covers semantic text components such as commands, links, paths, and themed text, plus `Noora().format(...)`.
1noora-collapsible-step
Use when a Swift CLI needs Noora to stream multiple log lines during a task and collapse them on success or failure. Covers `collapsibleStep`, `visibleLines`, and writing readable progress lines.
1noora-text-prompt
Use when gathering free-form text input with Noora in a Swift CLI. Covers `textPrompt`, default values, collapse behavior, and validation rules such as `NonEmptyValidationRule`.
1noora-progress-bar-step
Use when a Swift CLI needs percentage-based progress with Noora. Covers `progressBarStep`, reporting values from 0 to 1, and choosing bar updates for downloads, migrations, and batch work.
1