Skip to main content

Default View

The playground can be loaded in one of the following views:

split

Both the code editor and the result page are visible. This is the default.

Example: https://livecodes.io/?view=split

Demo:

show code
import { createPlayground } from 'livecodes';

const options = {
"view": "split"
};
createPlayground('#container', options);

editor

The code editor is visible, while the result page is collapsed. The result page can be shown by dragging the split gutter, or clicking the "Toggle Result" button.

Example: https://livecodes.io/?view=editor

Demo:

show code
import { createPlayground } from 'livecodes';

const options = {
"view": "editor"
};
createPlayground('#container', options);

result

The result page is visible, while the code editor is collapsed. The code editor can be shown by dragging the split gutter, or clicking one of the editor tabs.

Example: https://livecodes.io/?view=result

Demo:

show code
import { createPlayground } from 'livecodes';

const options = {
"view": "result"
};
createPlayground('#container', options);

Display Mode vs Default View

info

"Display Mode" is different from "Default View".

In editor display mode, only the editor is loaded and the result page is not available. While editor default view shows the editor by default, and the result page can be shown by dragging the split gutter.

The same applies for result display mode and default view.