Declare your UI, manage state with hooks
use telex::prelude::*;
struct App;
impl Component for App {
fn render(&self, cx: Scope) -> View {
let count = state!(cx, || 0);
View::vstack()
.child(View::text(format!("Count: {}", count.get())))
.child(
View::button()
.label("+")
.on_press(with!(count => move || count.update(|n| *n += 1)))
.build()
)
.build()
}
}
fn main() {
telex::run(App).unwrap();
}What's in the box
Reactive State
Order-independent state! macro, effect! for side effects. channel!/port! for external events, interval! for timers, reducer! for state machines. No Arc, no Send bounds.
Rich Widgets
Text, TextInput, TextArea, Button, Checkbox, List, Table, Tree, Tabs, Modal, Menu, Form, Toast, Markdown, Split, Slider, and more.
Flexbox Layout
VStack, HStack, Box with flex, min/max constraints, percentage sizing. Split panes for resizable panels.
Focus Management
Tab navigation, modal focus containment, cursor navigation, initial focus. Indicators appear only on keyboard use.
Theming
14 built-in themes: Catppuccin, Dracula, Gruvbox, Nord, Tokyo Night, and more. One line to switch.
Unicode
Proper grapheme cluster handling. Emoji, CJK, and combining characters all render at correct widths.
Telex