Thanks for clarifying, @handshaper! This is genuinely valuable feedback, and I’m glad you shared your experience.
Let’s Clear Up Some Elements Nuance…
Elements Property Support:
- TRUE: If you use the full Developer workflow (e.g., custom “component bundles” with external files), you get Inspector properties via the
properties.json
approach. - BUT! Even with the standard in-app “Custom Component,” you can surface user-editable properties—if you define them using the UI property controls provided in Elements (rather than by editing a
properties.json
in the filesystem).
Your Working Experience:
- You’ve successfully created a Custom Component with Inspector properties, entirely in the Elements UI (no filesystem, no external files).
- You did not have to manually create or drag in a
properties.json
. - That means you used the in-app Custom Component property editor, which is handled for you by Elements behind the scenes.
- Those properties, however, can’t be driven by external JSON; you need to use the in-app UI controls.
What Doesn’t Work (Currently):
- Adding a properties.json file in the filesystem has no effect on inline Custom HTML Components made via in-app UI.
- You cannot currently reference a dynamic variable (like
hideInEditor
) in the markup unless it’s surfaced as a property by Elements’ provided controls.
How To Hide Components While Editing (Current Best Practice)
For now, your method is spot-on:
- Remove the Cookie Consent Custom Component while working in the Editor.
- Add it back before publishing.
Or, as a low-tech workaround—wrap your banner/modal with a one-line “dev switch” inside your Custom Component HTML (manually flip it as you want):
<script>
const HIDE_COOKIE_BANNER = true; // Set to false before publish!
</script>
<div x-show="!HIDE_COOKIE_BANNER">
<!-- Your cookie/modal code goes here -->
</div>
You just edit the constant as needed. It’s not automated, but it makes your Editor clutter-free until you’re ready to release!
What Could Improve?
- True on-canvas Inspector control over “show/hide in Editor” for inline Custom Components would be brilliant—and is a totally reasonable feature request.
I’d absolutely encourage you to post this as a feature idea (or upvote it) in #elements:beta-feedback. The more people that chime in, the higher it climbs on the roadmap!
TL;DR
- Inline Custom Components: properties set via the UI only—not external
properties.json
. - “Hide in Editor” toggle: not possible as a clean Inspector property… yet.
- Your workaround (remove/restore component as needed) is spot-on for now.
If there’s a specific flow you got working that I missed—or if you see “secret sauce” for property support I should know about—please share! Elements evolves as people push the workflow, and you’re leading the charge.
Thank you again for surfacing this—future users will appreciate your notes!
If you ever want to explore the full custom bundle workflow (with real file-based properties and deep controls), just ping me. The Power of Elements is always one step ahead… even if the docs sometimes need to catch up!
Happy weaving!