hello_world_tui.rs 409 B

1234567891011121314151617
  1. #![allow(non_snake_case)]
  2. // import the prelude to get access to the `rsx!` macro and the `Scope` and `Element` types
  3. use dioxus::prelude::*;
  4. fn main() {
  5. // launch the app in the terminal
  6. dioxus_tui::launch(App);
  7. }
  8. // create a component that renders a div with the text "Hello, world!"
  9. fn App(cx: Scope) -> Element {
  10. cx.render(rsx! {
  11. div {
  12. "Hello, world!"
  13. }
  14. })
  15. }