What you describe is similar to what the flutter developers
are trying to achieve with their web port 'Hummingbird'. Flutter is currently almost entirely aimed at mobile apps, but it would be wonderful to be able to share UI code between apps and web frontend, with a consistent layout model.
This post is a good read: https://medium.com/flutter-io/hummingbird-building-flutter-f...