form.rs 530 B

1234567891011121314151617181920212223
  1. //! Example: README.md showcase
  2. //!
  3. //! The example from the README.md.
  4. use dioxus::prelude::*;
  5. fn main() {
  6. dioxus::desktop::launch(app);
  7. }
  8. fn app(cx: Scope) -> Element {
  9. cx.render(rsx! {
  10. div {
  11. h1 { "Form" }
  12. form {
  13. oninput: move |ev| println!("{:?}", ev),
  14. input { r#type: "text", name: "username" }
  15. input { r#type: "text", name: "full-name" }
  16. input { r#type: "password", name: "password" }
  17. }
  18. }
  19. })
  20. }