Skip to Content
ReferenceFeature flags

Feature Flags

FrankenTUI uses Cargo features to keep the default build small and let consumers opt in to tracing, telemetry, visual FX, and GPU acceleration. All tracing and telemetry features are off by default — enabling them adds compile-time cost only when requested.

Enable features per-crate in your Cargo.toml:

[dependencies] ftui-core = { version = "*", features = ["tracing"] } ftui-render = { version = "*", features = ["tracing"] } ftui-runtime = { version = "*", features = ["tracing", "telemetry"] }

ftui-core

FeatureWhat It EnablesDefault
tracingStructured spans for terminal lifecycleOff
tracing-jsonJSON output via tracing-subscriberOff

ftui-core::tracing emits spans around terminal setup, teardown, input parsing, and capability probing. Pair with tracing-json to get newline- delimited JSON suitable for log aggregation. See /runtime/telemetry for integration patterns.

ftui-render

FeatureWhat It EnablesDefault
tracingPerformance spans for diff/presenterOff

ftui-render::tracing wraps the hot path with tracing spans so you can see per-frame diff cost, presenter byte counts, and flush timings without modifying the render pipeline. Overhead when the feature is off is zero — the calls compile away.

ftui-runtime

FeatureWhat It EnablesDefault
tracingRuntime loop instrumentationOff
telemetryOpenTelemetry export (OTLP)Off

ftui-runtime::tracing instruments the Elm loop (update, view, subscription reconciliation, effect execution).

ftui-runtime::telemetry adds OTLP export. When the feature is off, telemetry code and dependencies are excluded. When the feature is on but env vars are unset, overhead is a single startup check. Configure the exporter via OTEL_EXPORTER_OTLP_ENDPOINT — see /reference/env-vars.

ftui-extras

FeatureWhat It EnablesDefault
visual-fxCore types + Backdrop widget + CPU helpersOff
visual-fx-metaballsMetaballs effect (depends on visual-fx)Off
visual-fx-plasmaPlasma effect (depends on visual-fx)Off
canvasCanvas adapters for sub-cell Braille/block renderingOff
fx-gpuOptional GPU acceleration (strictly opt-in)Off
markdownMarkdown rendererOff

fx-gpu default backends: Vulkan, GLES, DX12. Metal is intentionally disabled to avoid the unmaintained paste dependency; macOS uses CPU FX unless a Metal-safe path is added. See /concepts/visual-fx for the composition model.

Visual FX can be expensive. They automatically degrade via FxQuality when the frame budget is tight — but you can also force quality with set_quality_override() for testing.

ftui-widgets

FeatureWhat It EnablesDefault
command-paletteBayesian command palette widget + evidence ledgerOn
virtualizedFenwick-tree virtualized list + conformal height boundsOn

ftui-a11y and ftui-i18n

Both crates expose a minimal feature surface — see their individual pages:

Interaction with Env Vars

Several features are gated at runtime in addition to compile time:

  • fx-gpu respects FTUI_FX_GPU_DISABLE=1 and FTUI_FX_GPU_FORCE_FAIL=1.
  • telemetry only exports when OTEL_EXPORTER_OTLP_ENDPOINT is set.
  • Tracing output is controlled by standard RUST_LOG filters.

See /reference/env-vars for the complete catalog.

How to Choose Features

  • Library users: start with zero features and add tracing only when you need instrumentation.
  • Application authors: enable tracing on ftui-runtime plus tracing-json on ftui-core for structured logs in production.
  • Observability users: add telemetry on ftui-runtime and configure OTEL env vars.
  • Demo and showcase builders: enable visual-fx, visual-fx-metaballs, visual-fx-plasma, and optionally fx-gpu.

See Also