Skip to main content

Crate telex

Crate telex 

Source
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.
ButtonBuilder
Builder for Button views.
ButtonNode
A button node.
CanvasBuilder
Builder for Canvas views.
CanvasNode
A canvas node for pixel-level drawing using Kitty graphics protocol.
CheckboxBuilder
Builder for Checkbox views.
CheckboxNode
A checkbox node.
CommandPaletteBuilder
Builder for CommandPalette views.
CommandPaletteNode
A command palette overlay for searching and executing commands.
CustomNode
A node wrapping a user-defined custom widget.
ErrorBoundaryBuilder
Builder for error boundary views.
ErrorBoundaryNode
An error boundary that catches panics in its child view.
FormBuilder
Builder for Form views.
FormFieldBuilder
Builder for FormField views.
FormFieldNode
A form field with label, input, and error display.
FormNode
A form container that manages field validation.
HStackBuilder
Builder for HStack views.
HStackNode
A horizontal stack container.
ImageBuilder
Builder for Image views.
ImageNode
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.).
ListBuilder
Builder for List views.
ListNode
A selectable list node.
Menu
A menu in the menu bar.
MenuBarBuilder
Builder for MenuBar views.
MenuBarNode
A horizontal menu bar with dropdown menus.
ModalBuilder
Builder for Modal views.
ModalNode
A modal dialog node.
PaletteCommand
A command in the command palette.
RadioGroupBuilder
Builder for RadioGroup views.
RadioGroupNode
A radio group node (mutually exclusive options).
Scope
Context passed to components during rendering.
SliderBuilder
Builder for slider views.
SliderNode
A slider for bounded numeric values (e.g., MIDI CC, volume, brightness).
SpacerNode
Flexible space that expands to fill available space.
SplitBuilder
Builder for Split pane views.
SplitNode
A split pane container node.
State
A reactive state handle that can be copied and shared.
StreamHandle
Handle for stream state that can be stored and cloned.
TableBuilder
Builder for Table views.
TableColumn
A column definition for a table.
TableNode
A data table node with columns and rows.
TabsBuilder
Builder for Tabs views.
TabsNode
A tabbed interface container node.
Terminal
Terminal wrapper that handles setup, rendering, and cleanup.
TerminalBuffer
A 2D grid of terminal cells with cursor tracking.
TerminalBuilder
Builder for Terminal views.
TerminalHandle
Handle to a running PTY process.
TerminalNode
Node representing an interactive PTY terminal emulator.
TextAreaBuilder
Builder for TextArea views.
TextAreaNode
A multi-line text area node.
TextBuilder
Builder for styled Text views.
TextInputBuilder
Builder for TextInput views.
TextInputNode
A text input node.
TextNode
A text node containing string content with optional styling.
ToastContainerBuilder
Builder for ToastContainer views.
ToastContainerNode
A container for displaying toast notifications.
ToastItem
A toast item for rendering.
TreeBuilder
Builder for Tree views.
TreeItem
A single item in a tree view.
TreeNode
A hierarchical tree view node.
VStackBuilder
Builder for VStack views.
VStackNode
A vertical stack container.

Enums§

Align
Alignment along the cross axis (align).
Async
Represents the state of an async operation.
Color
Represents a color.
ColumnWidth
Column width specification for tables.
Event
Represents an event.
Justify
Alignment along the main axis (justify).
KeyCode
Represents a key.
LayoutMode
Layout mode for stack containers.
MenuItemNode
An item in a menu.
Orientation
Orientation for split panes.
StreamState
Represents the state of a streaming operation.
TabPosition
Position of the tab bar.
TextAlign
Text alignment for table columns.
ToastLevelView
Severity level for visual rendering of toasts.
ToastPosition
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.
EventSource
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).
ChangeCallback
Callback type for text change events (receives new text).
CommandCallback
Callback type for command execution events (receives command ID).
FormSubmitCallback
Callback type for form submission (receives all field values).
SelectCallback
Callback type for selection events (receives selected index).
SliderCallback
Callback type for slider value changes.
TextStreamHandle
Convenience handle specifically for text streaming. Automatically accumulates string tokens.
ToggleCallback
Callback type for toggle events (receives new state).
TreeActivateCallback
Callback type for tree activation events (receives path to activated item).
TreePath
Path to a node in a tree (indices at each level).
TreeSelectCallback
Callback type for tree selection events (receives path to selected item).