Skip to content

Can leptos draw graphics on canvas? #2245

Answered by gbj
xtrn143 asked this question in Q&A
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 1 reply

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

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants