Feature Flags

June 11, 2026 · View on GitHub

Canonical source: Cargo.toml [features]. This document is a human-readable companion.

This guide is the human-readable feature matrix. For the canonical API surface, also check docs.rs and src/lib.rs.

Core model

  • unicode-width, unicode-segmentation, smallvec, and compact_str are always part of the small core (4 direct required deps).
  • crossterm is a default feature, not a hard requirement.
  • Resolved tree (cargo tree, deduped): 10 crates with default-features = false, 25 with default features, 67 with --features full — versus 68 for a ratatui + crossterm app. "Light" refers to this dependency footprint and the small public API, not stripped binary size or build speed.
  • The low-level core (Backend, AppState, frame(), widgets, events, style/layout types) works without terminal I/O.

Main flags

FlagWhat it enables
crosstermBuilt-in terminal runtime: run(), run_with(), run_inline(), terminal polling, clipboard query, terminal helpers
asyncrun_async() and tokio-based message-driven apps
serdeSerialize/Deserialize for style, theme, and layout-related public types
imageImage loading helpers for terminal image widgets
qrcodeui.qr_code(...)
syntaxConvenience: enables all per-language syntax-* bundles below
syntax-*Per-language syntax bundles such as syntax-rust, syntax-python, syntax-typescript
kitty-compresszlib compression for Kitty image protocol uploads
fullConvenience bundle: enables crossterm, async, serde, image, qrcode, and kitty-compress (does not include syntax — add language bundles separately)

What disappears without crossterm

When you disable default features and do not re-enable crossterm:

  • run() and terminal-owned loops are unavailable
  • terminal helpers such as color scheme detection are unavailable
  • terminal clipboard query support is unavailable

What still remains:

  • Backend
  • AppState
  • frame()
  • Context, widgets, events, styles, layout, charts

That makes SLT usable as a rendering core for non-terminal environments.

GoalSuggested dependency
Regular terminal appsuperlighttui = "..."
Async terminal appsuperlighttui = { version = "...", features = ["async"] }
QR outputsuperlighttui = { version = "...", features = ["qrcode"] }
Syntax-highlighted code blockssuperlighttui = { version = "...", features = ["syntax", "syntax-rust"] }
Custom backend onlysuperlighttui = { version = "...", default-features = false }

AI-friendly rule of thumb

When reading or generating code:

  • if you see run() / run_inline() / clipboard query usage, assume crossterm is needed
  • if you see run_async(), assume async is needed
  • if you see ui.qr_code(...), assume qrcode is needed
  • if you see code_block_lang(...) with tree-sitter behavior, check syntax flags
  • docs/BACKENDS.md - no-default-features and custom backend path
  • docs/README.md - docs index
  • src/lib.rs - crate-level rustdoc and cfg-gated API surface