webcomponents.rs 928 B

12345678910111213141516171819202122232425262728
  1. //! Example: Web Components
  2. //! -----------------------
  3. //!
  4. //! Web components are a flavor of html elements that can be user-defined.
  5. //! See: https://www.webcomponents.org for more information.
  6. //!
  7. //! Users who use webcomponents typically don't use Dioxus. However, if you would like to use webcomponents in Dioxus,
  8. //! you can easily create a new custom element with compile-time correct wrappers around the webcomponent.
  9. //!
  10. //! We don't support building new webcomponents with Dioxus, however.
  11. //!
  12. use dioxus::{builder::ElementBuilder, prelude::NodeFactory};
  13. fn main() {}
  14. mod dioxus_elements {
  15. use dioxus::prelude::DioxusElement;
  16. struct custom_element;
  17. impl DioxusElement for custom_element {
  18. const TAG_NAME: &'static str = "custom_element";
  19. const NAME_SPACE: Option<&'static str> = None;
  20. }
  21. // Re-export the normal html namespace
  22. pub use dioxus::prelude::dioxus_elements::*;
  23. }