Ribir - Non-intrusive GUI Framework for Rust
Use Rust to build multi-platform applications from a single codebase.
Ribir is a Rust GUI framework that helps you build beautiful and native multi-platform applications from a single codebase.
Experience a novel approach to UI development that's directly based on your data structure APIs. Any data mutation will trigger a precise UI update. Your focus should be on designing your data structure and its APIs. Then, you can describe your data's UI without intruding on its logic.
At First Glance
A simple example of a counter:
use ribir :: prelude :: * ; fn main ( ) { App :: run_with_data ( || Stateful :: new ( 0 ) , move | cnt : & ' static Stateful < i32 > | { button ! { h_align : HAlign :: Center , v_align : VAlign :: Center , on_tap : move |_| * $write ( cnt ) += 1 , @pipe! ( $read ( cnt ) . to_string ( ) ) } } ) ; }
To use Ribir without DSL:
use ribir :: prelude :: * ; fn main ( ) { App :: run_with_data ( || Stateful :: new ( 0 ) , move | cnt : & ' static Stateful < i32 > | { let c_cnt = cnt . clone_writer ( ) ; let mut btn = Button :: declarer ( ) ; btn . on_tap ( move |_| * c_cnt . write ( ) += 1 ) . with_h_align ( HAlign :: Center ) . with_v_align ( VAlign :: Center ) ; btn . finish ( ) . with_child ( pipe ! ( $read ( cnt ) . to_string ( ) ) ) } ) ; }
More Examples
... continue reading