Feature Idea: Demo state controls outside iframe preview #30
casparroelofs
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem & motivation
When building section previews with demo state controls (e.g., toggling between "loading", "error", "success" states), the controls currently live inside the preview component itself. Since
ScreenDesignPagerenders previews in an iframe for style isolation, these controls appear inside the device mockup, overlapping the actual design.This makes it hard to evaluate the design at different states without the controls interfering visually.
Proposed change & alternatives
Proposed change: Move demo state controls to
ScreenDesignPage.tsx(outside the iframe) and communicate with the preview viapostMessage.This would involve:
demo-config.jsonor exported from the preview component)ScreenDesignPagerendering controls based on that configpostMessageto update their stateAlternatives considered:
User experience impact
Updating & compatibility considerations
demo-config.jsonwould get external controlspostMessageeventBeta Was this translation helpful? Give feedback.
All reactions