utopia_tui 2.0.0
utopia_tui: ^2.0.0 copied to clipboard
A comprehensive, high-performance Terminal User Interface (TUI) library for Dart that makes building beautiful console applications effortless.
2.0.0 #
Breaking Changes #
- Removed
dart_consoledependency - library now usesdart:iodirectly with zero external dependencies - Removed interactive wrapper classes -
InteractiveMenu,InteractiveTextInput,InteractiveScrollVieware removed; interactive behavior is now built intoTuiList,TuiTextInput, andTuiScrollViewdirectly TuiCellAPI changed - now stores aString char(grapheme cluster) instead ofint codePoint; useTuiCell(char: 'A')instead ofTuiCell(codePoint: 65)- Edit/scroll mode uses Ctrl+E instead of ESC (ESC is unreliable with
dart_console-style input)
Added #
TuiFocusManager- declarative tree-based focus navigation with directional movement (up/down/left/right), Tab cycling, andfocusByIdTuiFocusNode- sealed class hierarchy (.leaf(),.row(),.column()) for spatial focus layoutTuiFocusPlaceholder- focusable component for panes without interactive content- Wide character support - proper handling of emoji, CJK, and fullwidth characters in rendering and word wrapping
- Grapheme cluster support - zero-width characters (variation selectors, combining marks, ZWJ) are grouped with their base character
TuiSurface.displayWidth()- accurate terminal display width calculation- Alternate screen buffer - clean terminal restore on Ctrl+C exit
- RGB color support -
TuiStylenow supportsfgRgbandbgRgb
Fixed #
- Terminal not restoring properly on Ctrl+C exit (stuck in raw mode)
- Wide characters (emoji) overwriting panel right borders
- Zero-width characters (❤️ variation selector) causing column misalignment
- Focus highlighting only working for TextInput/ScrollView, now works for all panes
- Edit mode in TextInput intercepting 'e' key instead of allowing typing
Improved #
- Components (
TuiList,TuiTextInput,TuiScrollView,TuiTabs) now extendTuiInteractiveComponentdirectly - Async stdin key reading - no more isolate-based input, fully cancellable
- Word wrapping accounts for display width of wide characters
- Vim-style navigation (h/j/k/l) alongside arrow keys in interactive components
1.1.0 #
- Dialog support with modal overlays
1.0.0 #
Added #
Core Framework
- TuiApp: Base application class with event loop and rendering pipeline
- TuiRunner: Application runner with terminal setup and cleanup
- TuiContext: Application context with dimensions and event management
- TuiSurface: High-performance canvas for character-based rendering
- TuiCanvas: Advanced surface with border rendering capabilities
Component System
- TuiComponent: Base component class for paintSurface architecture
- Layout Components:
TuiRow: Horizontal layout with flexible widths and gap supportTuiColumn: Vertical layout with flexible heights and gap supportTuiPadding: Padding wrapper componentTuiCenter: Center alignment component
- UI Components:
TuiText: Text rendering with multiline supportTuiButton: Interactive button with hover and click statesTuiList/TuiListView: Selectable list componentTuiTextInput/TuiTextInputView: Text input with cursor and editingTuiProgressBar: Progress indicator with customizable stylingTuiSpinner: Animated loading spinnersTuiStatusBar: Status bar with left/center/right sectionsTuiTable: Data table with headers and stylingTuiTabs: Tab navigation componentTuiScrollView: Scrollable content containerTuiCheckbox: Interactive checkbox componentTuiPanelBox: Container with borders and title
Styling & Theming
- TuiStyle: Comprehensive styling with ANSI color support (256 colors)
- TuiTheme: Built-in themes (dark, light, contrast, monokai, oceanic)
- TuiBorderChars: Border character sets (ASCII, rounded, thick, double)
- Styling Features:
- Foreground and background colors
- Bold, italic, underline, strikethrough
- Custom border styles and characters
Event System
- TuiKeyEvent: Keyboard input handling with special key support
- TuiResizeEvent: Terminal resize detection
- TuiTickEvent: Timer-based events for animations
- Interactive Components: Focus management and input routing
Core Utilities
- TuiRect: Rectangle geometry for layouts and clipping
- TuiLayout: Flexible layout algorithms for rows and columns
- Terminal Integration: Cross-platform terminal control
- ANSI Support: Full ANSI escape sequence generation
Technical Features #
- High Performance: Optimized rendering with minimal screen updates
- Memory Efficient: Efficient character cell management
- Error Resilient: Robust error handling throughout the framework
- Well Tested: Comprehensive unit test suite with 140+ tests
- Type Safe: Full Dart type safety with null safety support
Documentation #
- Complete API documentation with examples
- Quick start guide and comprehensive README
- Example applications demonstrating key features
Development #
- Dart 3.9+ compatibility
- Linting with official Dart lints
- Comprehensive test coverage for all components