SwiftUI semantics, drawn in terminal cells.

Build terminal apps with views, state, focus, and animation. Compile a native executable for macOS, Linux, or Windows.

Live demoA real SwiftTUI app in your browser
Open separately

A real SwiftTUI app, running live in your browser.

Click Increment, or focus the demo and press Space.
CounterView · excerpt
@State private var count = 0

var body: some View {
  VStack(spacing: 1) {
    TextFigure("\(count)", font: .future)
    Button("Increment") { count += 1 }
  }
}

Change the state. SwiftTUI updates the view.

View and copy the complete Swift app

This minimal example leaves out the live counter’s ripple animation.Explore the demo source.

CounterApp.swift
import SwiftTUI

struct CounterView: View {
  @State private var count = 0

  var body: some View {
    VStack(spacing: 1) {
      TextFigure("\(count)", font: .future)
        .frame(minWidth: 14, alignment: .center)
      Button("Increment") { count += 1 }
    }
    .frame(maxWidth: .infinity, maxHeight: .infinity)
  }
}

@main
struct CounterApp: App {
  var body: some Scene {
    WindowGroup("Counter") { CounterView() }
  }
}

01 / Built with SwiftTUI

Small beginnings. Whole applications.

These are maintained example apps. Explore the source, clone a repo, and run them yourself.

GIF Editor with a pixel-art canvas, layer controls and frame timeline

GIF Editor

A canvas. A timeline. A terminal.

Paint frames, compose layers, scrub the timeline, and undo your edits.

Drawing · pointer input · animation

View source
Terminal Workspace showing tabs and multiple live shell panes

Terminal Workspace

Build a workspace

Tabs and split panes around live shells, with a command palette to move between them.

Tabs · focus · embedded terminals

View source
csvui displaying rows of a world cities dataset

csvui

Work with real data

Browse and edit a 34,000-row table, with search, filtering, and sorting.

Tables · selection · scrolling

View source
Editors, dashboards, file browsers, and more.Browse every example

02 / The programming model

Describe the interface. Keep building.

SwiftTUI connects state, layout, and input so your app can grow from one control to a whole workspace.

State → view → cells

Change state. See it happen.

Declare the view once. When tracked state changes, SwiftTUI updates dependent views and emits the terminal cells that changed.

Explore state and observation
One update, from action to output
  1. 01 / Actioncount += 1
  2. 02 / State@State count
  3. 03 / ViewText("\(count)")

The runtime handles invalidation and redraw.

Composition → workspace

Give every pane a purpose.

Compose lists, tables, tabs, and scroll views. Keep focus with the active control and state with the view that owns it.

Explore layout and collections
A workspace, built from views
FilesChangesLogs
ListSourcesTestsPackage.swift
TableName StatusApp.swift ModifiedModel.swift Ready
Focus · selection · keyboard commands

Layout illustration. Compose each region from views.

App → terminal session

Meet the terminal you’re in.

Terminal capabilities are negotiated per session. Use richer color, images, and mouse input where supported, with explicit controls for simpler output.

Explore terminal behavior
Choose the output for the session
Color
Truecolor or a simpler palette
Images
Kitty / Sixel when supported
Input
Keyboard, plus supported mouse input

--no-color--ascii--reduce-motion

03 / Get started

Your terminal. Your first app.

Run the same counter locally with Swift 6.4 on macOS, Linux, or Windows.

Need a Swift toolchain?
Run the counter
git clone https://github.com/SwiftTUI/swift-tui-counter-demo.git
cd swift-tui-counter-demo
swift run --package-path counter counter

Space or a click increments.Ctrl-C restores your shell.

Ready to make it your own?Build your first app

04 / Take your views further

Start in the terminal. Bring your views along.

Share state and actions across hosts, and adapt the interface for a keyboard, pointer, or touch.

01 / Terminal

A native executable

Build with SwiftPM for macOS, Linux, or Windows.

Run an app

02 / Browser

A static web bundle

Compile to WebAssembly and host it on the web, like the live counter above.

Deploy to the browser

03 / Native app

Inside SwiftUI

Embed the same views in a macOS or iOS app with SwiftUIHost.

See the hosts

Also available: an Android arm64 preview. See platform requirements andhow to adapt an interface to its host.

Community

Build with us.

Ask a question, share your app, or help shape the framework. Development happens in public.