wandb / openui

OpenUI let's you describe UI using your imagination, then see it rendered live.
https://openui.fly.dev
Apache License 2.0
16.81k stars 1.47k forks source link

Exporting complete HTML and CSS #130

Closed cashgarman closed 1 month ago

cashgarman commented 1 month ago

Excellent project first of all!

Unless I am missing something, copying or saving the resulting HTML into something usable, it only seems to copy small portion of the HTML, with a lot of the CSS styling missing.

cashgarman commented 1 month ago

Page in OpenUI: image

Page in browser after copying the HTML into a .html file: image

VideoFX commented 1 month ago

I just ran into this as well. Is there a reference to the rest of the files needed to complete this?

vanpelt commented 1 month ago

@VideoFX @cashgarman I just pushed a change to main and deployed to the demo app. Copying or downloading now includes the needed wrapper to render properly. For future reference the needed template is:

<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.tailwindcss.com"></script>
  </head>
  <body>
    ${code}
  </body>
</html>