Skip to content
Discussion options

You must be logged in to vote

Yes and no.

It is entirely possible to work with any old DOM element using the tools provided by web-sys, which provides a Rust interface for all DOM APIs. For example, can can easily can document().get_element_by_id("...") to get access to an element.

Like any framework, Leptos works primarily by adding functionality to element that it creates. So we'd tend to think about mounting a Leptos application to a particular DOM element, rather than using Leptos to add some functionality to an existing DOM element. You'd do this by using mount_to(some_element) rather than the more general mount_to_body(), and it's completely possible.

It is also possible to just use some of the helper utilities …

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Tahinli
Comment options

@gbj
Comment options

gbj Apr 6, 2025
Maintainer

@Tahinli
Comment options

@gbj
Comment options

gbj Apr 6, 2025
Maintainer

@Tahinli
Comment options

Answer selected by Tahinli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants