Desktop UI and Web UI models are so different that in reality you cannot use the same codebase on 100% in both targets.
Web UI uses traditional Web's "endless tape" model where only width is known. This does not really work on desktop where width and height are finite. See this Sciter based app https://notes.sciter.com/ as an example.
> reusing the vast selection of libraries for web
If you do need this then you can use Sciter's WebView that is a <frame> backed by system browser:
https://sciter.com/wp-content/uploads/2022/04/sciter-webview...