Documentation

SwiftTUI documentation

Organized by what you're doing: your first hour, then the reference guides for views, state, and focus, charts, and what lies beyond the terminal. The module-by-module API reference is at the end.

Your first hour

Read these in order. Each one picks up where the last left off, from an empty package to an app that handles state, focus, and the terminal's own rules.

  1. 01Add it to your appPick a toolchain, add the package, paste the counter, swift run.
  2. 02Authoring ViewsCompose containers, local state, focused controls, and modifiers around a body-driven tree.
  3. 03State, Environment, and FocusState, observation, environment, and focus share one runtime invalidation path.
  4. 04Running AppsThe @main entry point, the standard flags, exit keys, and rendering one frame without a TTY.
  5. 05Coming from SwiftUIWhat transfers unchanged, which reflexes need retraining, and what is not here yet.

Build your interface

The reference guides, one per subsystem, from the SwiftTUIViews catalog. Read them as you need them.

Charts

Sparklines, bar and line charts, heatmaps, meters, and calendar views ship separately as swift-tui-charts, composed on the same view surface.

At run time

What a running terminal app reads and can do, from the SwiftTUIRuntime catalog.

Beyond the terminal

Terminal first, not terminal only. The same app runs in a browser, inside native SwiftUI windows, and on Android; these guides own that path and its platform notes.

Concepts and background

API reference by module

The combined DocC archive documents each module. Most app code touches only the first row.

What you import

Hosts and opt-in products

The last group declares types that reach app code through re-export — CellSize, Alignment,PreferenceKey, SwiftTUIOptions — so their pages document symbols you use, behind imports you never write.