Expand description
Telex - A DX-first TUI framework for Rust.
Build terminal apps that feel good to write.
Re-exports§
pub use channel::ChannelDrain;pub use channel::ChannelHandle;pub use channel::PortHandle;pub use channel::WakingSender;pub use canvas::animated_canvas;pub use canvas::AnimatedCanvasBuilder;pub use canvas::DrawContext;pub use canvas::PixelBuffer;pub use image::ImageSource;
Modules§
- buffer
- canvas
- Canvas widget for pixel-level drawing using the Kitty graphics protocol.
- channel
- Channel and port primitives for external event sources.
- command_
system - Unified command system for Command Palette and Menu Bar.
- form
- Form validation system for declarative input validation.
- image
- Image widget for displaying images using the Kitty graphics protocol.
- markdown
- Markdown rendering for Telex.
- prelude
- Common imports for Telex applications.
- testing
- Testing utilities for Telex components.
- text
- Unicode-aware text handling for Telex.
- theme
- Theming support for Telex applications.
- toast
- Toast notification system for ephemeral messages.
- widget
- Custom widget trait for user-defined character-cell rendering.
Macros§
- assert_
snapshot - Assert that the rendered output matches a snapshot.
- async_
data - The async_data! macro for creating order-independent async data loading.
- channel_
macro - The channel! macro for creating typed inbound channels.
- effect
- The effect! macro for creating order-independent effects with dependencies.
- effect_
once - The effect_once! macro for creating order-independent effects that run once.
- interval
- The interval! macro for creating periodic timers.
- port
- The port! macro for creating bidirectional ports.
- reducer
- The reducer! macro for creating order-independent state with dispatch.
- require_
api - Check that your code is compatible with the current Telex API version.
- state
- The state! macro for creating order-independent state.
- stream
- The stream! macro for creating order-independent streams.
- terminal
- The terminal! macro for creating order-independent terminal handles.
- text_
stream - The text_stream! macro for creating order-independent text streams.
- text_
stream_ with_ restart - The text_stream_with_restart! macro for creating restartable text streams.
- view
- The view! macro for building UI trees with JSX-like syntax.
- with
- The with! macro for cloning state handles into closures.
Structs§
- BoxBuilder
- Builder for Box views.
- BoxNode
- A container with optional border, padding, and flex sizing.
- Button
Builder - Builder for Button views.
- Button
Node - A button node.
- Canvas
Builder - Builder for Canvas views.
- Canvas
Node - A canvas node for pixel-level drawing using Kitty graphics protocol.
- Checkbox
Builder - Builder for Checkbox views.
- Checkbox
Node - A checkbox node.
- Command
Palette Builder - Builder for CommandPalette views.
- Command
Palette Node - A command palette overlay for searching and executing commands.
- Custom
Node - A node wrapping a user-defined custom widget.
- Error
Boundary Builder - Builder for error boundary views.
- Error
Boundary Node - An error boundary that catches panics in its child view.
- Form
Builder - Builder for Form views.
- Form
Field Builder - Builder for FormField views.
- Form
Field Node - A form field with label, input, and error display.
- Form
Node - A form container that manages field validation.
- HStack
Builder - Builder for HStack views.
- HStack
Node - A horizontal stack container.
- Image
Builder - Builder for Image views.
- Image
Node - An image node for displaying images using Kitty graphics protocol.
- KeyBinding
- A keyboard shortcut definition.
- KeyEvent
- Represents a key event.
- KeyModifiers
- Represents key modifiers (shift, control, alt, etc.).
- List
Builder - Builder for List views.
- List
Node - A selectable list node.
- Menu
- A menu in the menu bar.
- Menu
BarBuilder - Builder for MenuBar views.
- Menu
BarNode - A horizontal menu bar with dropdown menus.
- Modal
Builder - Builder for Modal views.
- Modal
Node - A modal dialog node.
- Palette
Command - A command in the command palette.
- Radio
Group Builder - Builder for RadioGroup views.
- Radio
Group Node - A radio group node (mutually exclusive options).
- Scope
- Context passed to components during rendering.
- Slider
Builder - Builder for slider views.
- Slider
Node - A slider for bounded numeric values (e.g., MIDI CC, volume, brightness).
- Spacer
Node - Flexible space that expands to fill available space.
- Split
Builder - Builder for Split pane views.
- Split
Node - A split pane container node.
- State
- A reactive state handle that can be copied and shared.
- Stream
Handle - Handle for stream state that can be stored and cloned.
- Table
Builder - Builder for Table views.
- Table
Column - A column definition for a table.
- Table
Node - A data table node with columns and rows.
- Tabs
Builder - Builder for Tabs views.
- Tabs
Node - A tabbed interface container node.
- Terminal
- Terminal wrapper that handles setup, rendering, and cleanup.
- Terminal
Buffer - A 2D grid of terminal cells with cursor tracking.
- Terminal
Builder - Builder for Terminal views.
- Terminal
Handle - Handle to a running PTY process.
- Terminal
Node - Node representing an interactive PTY terminal emulator.
- Text
Area Builder - Builder for TextArea views.
- Text
Area Node - A multi-line text area node.
- Text
Builder - Builder for styled Text views.
- Text
Input Builder - Builder for TextInput views.
- Text
Input Node - A text input node.
- Text
Node - A text node containing string content with optional styling.
- Toast
Container Builder - Builder for ToastContainer views.
- Toast
Container Node - A container for displaying toast notifications.
- Toast
Item - A toast item for rendering.
- Tree
Builder - Builder for Tree views.
- Tree
Item - A single item in a tree view.
- Tree
Node - A hierarchical tree view node.
- VStack
Builder - Builder for VStack views.
- VStack
Node - A vertical stack container.
Enums§
- Align
- Alignment along the cross axis (align).
- Async
- Represents the state of an async operation.
- Color
- Represents a color.
- Column
Width - Column width specification for tables.
- Event
- Represents an event.
- Justify
- Alignment along the main axis (justify).
- KeyCode
- Represents a key.
- Layout
Mode - Layout mode for stack containers.
- Menu
Item Node - An item in a menu.
- Orientation
- Orientation for split panes.
- Stream
State - Represents the state of a streaming operation.
- TabPosition
- Position of the tab bar.
- Text
Align - Text alignment for table columns.
- Toast
Level View - Severity level for visual rendering of toasts.
- Toast
Position - Position for toast notifications.
- View
- The core view type - a node in the UI tree.
Constants§
- API_
VERSION_ MAJOR - Current API major version. For 0.x releases, minor version bumps may contain breaking changes.
- API_
VERSION_ MINOR - Current API minor version.
- API_
VERSION_ PATCH - Current API patch version.
Traits§
- Component
- A component that can render itself to a View.
- Event
Source - Trait for providing input events to the run loop.
Functions§
- is_
debug_ mode - Check if debug mode is enabled via TELEX_DEBUG environment variable.
- run
- Run the application with the given root component.
- run_
headless - Run a component headlessly with scripted events. For testing only.
- run_
headless_ timed - Runs the real event loop with no user input for
duration, then exits. - run_
with_ theme - Run the application with the given root component and theme.
Type Aliases§
- Callback
- Callback type for event handlers (no arguments).
- Change
Callback - Callback type for text change events (receives new text).
- Command
Callback - Callback type for command execution events (receives command ID).
- Form
Submit Callback - Callback type for form submission (receives all field values).
- Select
Callback - Callback type for selection events (receives selected index).
- Slider
Callback - Callback type for slider value changes.
- Text
Stream Handle - Convenience handle specifically for text streaming. Automatically accumulates string tokens.
- Toggle
Callback - Callback type for toggle events (receives new state).
- Tree
Activate Callback - Callback type for tree activation events (receives path to activated item).
- Tree
Path - Path to a node in a tree (indices at each level).
- Tree
Select Callback - Callback type for tree selection events (receives path to selected item).