Skip to content

Can leptos draw graphics on canvas? #2245

Answered by gbj
xtrn143 asked this question in Q&A
Jan 30, 2024 · 4 comments · 2 replies
Discussion options

You must be logged in to vote

Yes.

It really has very little to do with Leptos though, and everything to do with the underlying wasm-bindgen and web-sys crates that power the whole Rust/WASM web ecosystem.

I'd recommend starting with the canvas guides in the wasm-bindgen docs and going from there. You can easily get access to an HtmlCanvasElement from a Leptos NodeRef on a <canvas> in the view.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by xtrn143
Comment options

You must be logged in to vote
1 reply
@gbj
Comment options

gbj Oct 17, 2024
Maintainer

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jonathandinu
Comment options

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