Skip to content

See a code component as you write it

The code editor shows your component beside its files, rebuilt when you stop typing, and lets you try values for its properties without touching your site.

2 min readENFRNLDE
On this page 3 sections

When you write a code component, the code editor shows it running. Open it from the Assets tab with New code component, or open a code component you already have, if you may write code. The files are on the left. On the right, Preview lists the build's problems and the component's properties, and under them is the Live render.

What it shows

  • The component as it last built. A moment after you stop typing (about a third of a second) the code builds again, and the status reads Building…, then Built or the number of problems. When a build works, the render loads it and the component starts fresh.
  • A draft that doesn't build keeps the last version that built, and says so: "The live render shows the last version that built." Fix the problems listed under Preview and the render follows.
  • An error while the component runs shows its message under the render ("The component failed while rendering"), and in the frame in place of the component.

Try properties

Try properties has a field for each property of the type text, number, yes or no, colour or choice. Change a value and the running component gets it at once, without a new build. Back to the defaults puts them all back.

These values are for this render only: they are never saved to the component or to your site. A property of another type, or a colour taken from a token or a wide-gamut colour, renders with its default and says so. Slots and events aren't tried.

What it doesn't do

  • It doesn't save. The canvas keeps using the saved version until you select Save: "It builds. Save it to use this version on the canvas."
  • It doesn't run with your network or storage. The component runs alone in a sandboxed frame on a separate origin, with no network and no storage, so a component that fetches data or reads storage doesn't get any here.
  • It shows the component, not your page: the properties you try are the only input it has.