Blocks/Forms

Forms

New

A composable, huh-style form: typed fields grouped into (optionally conditional) wizard pages, per-field validation with inline errors, and dynamic fields whose visibility and options depend on other fields' values. Key-based and immutable — a Form is a TeaModel you can embed, or run one-shot with form.run().

Install the package

Every component ships in the single dart_tui package.

$dart pub add dart_tui
forms · dart_tui
Forms demo
Any field or Group accepts a hidden predicate, and titles/options can be computed dynamically with titleFor and optionsFor — recomputed live as other fields change.

Field types

PropertyTypeDescription
Field.input / .passwordSingle-line text, optionally masked.
Field.textMulti-line text (text area).
Field.fileFile path via the file picker.
Field.select / .selectOf<T>Single choice from options.
Field.multiSelect / .multiSelectOf<T>Multiple choices from options.
Field.confirmYes/no boolean.
Field.noteStatic, non-interactive information block.

Related