Skip to main content

Interface: EmbedOptions

An object that represents the playground embed options.

See docs for details.

Properties

appUrl

Optional appUrl: string

Allows loading the playground from a custom URL (e.g. a self-hosted app or a permanent URL).

If supplied with an invalid URL, an error is thrown.

Default

'https://livecodes.io'

Defined in

models.ts:314


config

Optional config: string | Partial<Config>

A configuration object or a URL to a JSON file representing a configuration object to load.

If supplied and is not an object or a valid URL, an error is thrown.

Default

{}

Defined in

models.ts:346


import

Optional import: string

A resource to import (from any of the supported sources).

Defined in

models.ts:351


lite

Optional lite: boolean

If true, the playground is loaded in lite mode.

Defined in

models.ts:356


loading

Optional loading: "click" | "eager" | "lazy"

Sets how the playground loads:

  • "eager": The playground loads immediately.
  • "lazy": A playground embedded low down in the page will not load until the user scrolls so that it approaches the viewport.
  • "click": The playground does not load automatically. Instead, a "Click-to-load" screen is shown.

Default

"lazy"

Defined in

models.ts:367


params

Optional params: Object

An object that represents the URL Query parameters, that can be used to configure the playground.

These 2 snippets produce similar output:

import { createPlayground } from 'livecodes';

// use config
createPlayground('#container', {
config: {
markup: {
language: 'markdown',
content: '# Hello World!',
},
},
});

// use params
createPlayground('#container', { params: { md: '# Hello World!' } });

Type declaration

NameTypeDescription
Binaryundefined | string-
Binary-selectorundefined | string-
Cundefined | string-
C-selectorundefined | string-
active?0 | 2 | 1 | EditorId-
activeEditor?0 | 2 | 1 | EditorId-
adocundefined | string-
adoc-selectorundefined | string-
allowLangChange?booleanIf false, the UI will not show the menu that allows changing editor language. Default ts true
appLanguage?AppLanguageSets the app UI language used.
appUrl?stringAllows loading the playground from a custom URL (e.g. a self-hosted app or a permanent URL). If supplied with an invalid URL, an error is thrown. Default ts 'https://livecodes.io'
artundefined | string-
art-selectorundefined | string-
art-templateundefined | string-
art-template-selectorundefined | string-
asundefined | string-
as-selectorundefined | string-
ascundefined | string-
asc-selectorundefined | string-
asciidocundefined | string-
asciidoc-selectorundefined | string-
assemblyscriptundefined | string-
assemblyscript-selectorundefined | string-
astroundefined | string-
astro-selectorundefined | string-
autosave?booleanIf true, the project is automatically saved on code change, after time delay. Default ts false
autotest?booleanIf true, the project is watched for code changes which trigger tests to auto-run. Default ts false
autoupdate?booleanIf true, the result page is automatically updated on code change, after time delay. Default ts true
babelundefined | string-
babel-selectorundefined | string-
bbundefined | string-
bb-selectorundefined | string-
bbcodeundefined | string-
bbcode-selectorundefined | string-
blocklyundefined | string-
blockly-selectorundefined | string-
blockly.xmlundefined | string-
blockly.xml-selectorundefined | string-
cundefined | string-
c++undefined | string-
c++-selectorundefined | string-
c-selectorundefined | string-
civetundefined | string-
civet-selectorundefined | string-
clangundefined | string-
clang-selectorundefined | string-
clang.cppundefined | string-
clang.cpp-selectorundefined | string-
clioundefined | string-
clio-selectorundefined | string-
cljundefined | string-
clj-selectorundefined | string-
cljcundefined | string-
cljc-selectorundefined | string-
cljsundefined | string-
cljs-selectorundefined | string-
clojureundefined | string-
clojure-selectorundefined | string-
clojurescriptundefined | string-
clojurescript-selectorundefined | string-
closeBrackets?booleanUse auto-complete to close brackets and quotes. Default ts true
coffeeundefined | string-
coffee-selectorundefined | string-
coffeescriptundefined | string-
coffeescript-selectorundefined | string-
common-lispundefined | string-
common-lisp-selectorundefined | string-
commonlispundefined | string-
commonlisp-selectorundefined | string-
compiledundefined | "" | "none" | "closed" | "open" | "full" | "true"-
config?string | Partial<Config> & stringA configuration object or a URL to a JSON file representing a configuration object to load. If supplied and is not an object or a valid URL, an error is thrown. Default ts {}
consoleundefined | "" | "none" | "closed" | "open" | "full" | "true"-
cpundefined | string-
cp-selectorundefined | string-
cppundefined | string-
cpp-selectorundefined | string-
cpp-wasmundefined | string-
cpp-wasm-selectorundefined | string-
cppmundefined | string-
cppm-selectorundefined | string-
cppwasmundefined | string-
cppwasm-selectorundefined | string-
csharpundefined | string-
csharp-selectorundefined | string-
cssundefined | string-
css-selectorundefined | string-
cssPreset?CssPresetIdCSS Preset to use.
customSettings?{ Binary: any ; C: any ; adoc: any ; art: any ; art-template: any ; as: any ; asc: any ; asciidoc: any ; assemblyscript: any ; astro: any ; autoprefixer: any ; babel: any ; bb: any ; bbcode: any ; blockly: any ; blockly.xml: any ; c: any ; c++: any ; civet: any ; clang: any ; clang.cpp: any ; clio: any ; clj: any ; cljc: any ; cljs: any ; clojure: any ; clojurescript: any ; coffee: any ; coffeescript: any ; common-lisp: any ; commonlisp: any ; convertCommonjs?: boolean ; cp: any ; cpp: any ; cpp-wasm: any ; cppm: any ; cppwasm: any ; csharp: any ; css: any ; cssmodules: any ; cssnano: any ; cwasm: any ; cxx: any ; defaultCDN?: CDN ; diagram: any ; diagrams: any ; dot: any ; edn: any ; ejs: any ; es: any ; eta: any ; fennel: any ; flow: any ; fnl: any ; gleam: any ; go: any ; golang: any ; graph: any ; h: any ; haml: any ; handlebars: any ; hbs: any ; hpp: any ; htm: any ; html: any ; ii: any ; imba: any ; imports?: Record<string, string> ; ixx: any ; jade: any ; javascript: any ; jl: any ; js: any ; json: any ; jsx: any ; julia: any ; less: any ; lightningcss: any ; liquid: any ; liquidjs: any ; lisp: any ; livescript: any ; ls: any ; lua: any ; lua-wasm: any ; luawasm: any ; malina: any ; malinajs: any ; mapImports?: boolean ; markdown: any ; md: any ; mdown: any ; mdx: any ; mjml: any ; mkdn: any ; ml: any ; mli: any ; mustache: any ; njk: any ; nunjucks: any ; ocaml: any ; perl: any ; pg: any ; pg.sql: any ; pglite: any ; pglite.sql: any ; pgsql: any ; pgsql.sql: any ; php: any ; php-wasm: any ; phpwasm: any ; pintora: any ; pl: any ; plt: any ; pm: any ; postcss: any ; postcssImportUrl: any ; postcssPresetEnv: any ; postgre.sql: any ; postgres: any ; postgresql: any ; postgresql.sql: any ; prolog: any ; prolog.pl: any ; pug: any ; purgecss: any ; py: any ; py-wasm: any ; py3: any ; pyodide: any ; python: any ; python-wasm: any ; pythonwasm: any ; pywasm: any ; r: any ; r-wasm: any ; rb: any ; re: any ; react-native: any ; react-native-tsx: any ; react-native.jsx: any ; react-native.tsx: any ; reason: any ; rei: any ; res: any ; rescript: any ; resi: any ; rich: any ; richtext: any ; riot: any ; riotjs: any ; rlang: any ; rstats: any ; rte: any ; rte.html: any ; ruby: any ; ruby-wasm: any ; rubywasm: any ; sass: any ; scheme: any ; scm: any ; scriptType?: "" | "module" | "text/liquid" | "text/python" | "text/r" | "text/ruby-wasm" | "text/x-uniter-php" | "text/php-wasm" | "text/cpp" | "text/perl" | "text/julia" | "text/biwascheme" | "text/commonlisp" | "text/tcl" | "text/prolog" | "application/json" | "application/lua" | "text/fennel" | "application/wasm-uint8" | "application/javascript" | "application/ecmascript" | "text/javascript" | "text/ecmascript" ; scss: any ; solid: any ; solid.jsx: any ; solid.tsx: any ; sql: any ; sqlite: any ; sqlite3: any ; stencil: any ; stencil.tsx: any ; styl: any ; stylis: any ; stylus: any ; sucrase: any ; svelte: any ; tailwindcss: any ; tcl: any ; teal: any ; template?: { data?: any ; prerender?: boolean } ; tl: any ; tokencss: any ; ts: any ; tsx: any ; twig: any ; types?: Types ; typescript: any ; unocss: any ; vento: any ; vto: any ; vue: any ; vue2: any ; vue3: any ; wasm: any ; wasm.cpp: any ; wasm.lua: any ; wasm.php: any ; wasm.py: any ; wasm.rb: any ; wast: any ; wat: any ; webassembly: any ; windicss: any ; xht: any ; xml: any }Defines custom settings for the current project.
customSettings.Binaryany-
customSettings.Cany-
customSettings.adocany-
customSettings.artany-
customSettings.art-templateany-
customSettings.asany-
customSettings.ascany-
customSettings.asciidocany-
customSettings.assemblyscriptany-
customSettings.astroany-
customSettings.autoprefixerany-
customSettings.babelany-
customSettings.bbany-
customSettings.bbcodeany-
customSettings.blocklyany-
customSettings.blockly.xmlany-
customSettings.cany-
customSettings.c++any-
customSettings.civetany-
customSettings.clangany-
customSettings.clang.cppany-
customSettings.clioany-
customSettings.cljany-
customSettings.cljcany-
customSettings.cljsany-
customSettings.clojureany-
customSettings.clojurescriptany-
customSettings.coffeeany-
customSettings.coffeescriptany-
customSettings.common-lispany-
customSettings.commonlispany-
customSettings.convertCommonjs?boolean-
customSettings.cpany-
customSettings.cppany-
customSettings.cpp-wasmany-
customSettings.cppmany-
customSettings.cppwasmany-
customSettings.csharpany-
customSettings.cssany-
customSettings.cssmodulesany-
customSettings.cssnanoany-
customSettings.cwasmany-
customSettings.cxxany-
customSettings.defaultCDN?CDN-
customSettings.diagramany-
customSettings.diagramsany-
customSettings.dotany-
customSettings.ednany-
customSettings.ejsany-
customSettings.esany-
customSettings.etaany-
customSettings.fennelany-
customSettings.flowany-
customSettings.fnlany-
customSettings.gleamany-
customSettings.goany-
customSettings.golangany-
customSettings.graphany-
customSettings.hany-
customSettings.hamlany-
customSettings.handlebarsany-
customSettings.hbsany-
customSettings.hppany-
customSettings.htmany-
customSettings.htmlany-
customSettings.iiany-
customSettings.imbaany-
customSettings.imports?Record<string, string>-
customSettings.ixxany-
customSettings.jadeany-
customSettings.javascriptany-
customSettings.jlany-
customSettings.jsany-
customSettings.jsonany-
customSettings.jsxany-
customSettings.juliaany-
customSettings.lessany-
customSettings.lightningcssany-
customSettings.liquidany-
customSettings.liquidjsany-
customSettings.lispany-
customSettings.livescriptany-
customSettings.lsany-
customSettings.luaany-
customSettings.lua-wasmany-
customSettings.luawasmany-
customSettings.malinaany-
customSettings.malinajsany-
customSettings.mapImports?boolean-
customSettings.markdownany-
customSettings.mdany-
customSettings.mdownany-
customSettings.mdxany-
customSettings.mjmlany-
customSettings.mkdnany-
customSettings.mlany-
customSettings.mliany-
customSettings.mustacheany-
customSettings.njkany-
customSettings.nunjucksany-
customSettings.ocamlany-
customSettings.perlany-
customSettings.pgany-
customSettings.pg.sqlany-
customSettings.pgliteany-
customSettings.pglite.sqlany-
customSettings.pgsqlany-
customSettings.pgsql.sqlany-
customSettings.phpany-
customSettings.php-wasmany-
customSettings.phpwasmany-
customSettings.pintoraany-
customSettings.plany-
customSettings.pltany-
customSettings.pmany-
customSettings.postcssany-
customSettings.postcssImportUrlany-
customSettings.postcssPresetEnvany-
customSettings.postgre.sqlany-
customSettings.postgresany-
customSettings.postgresqlany-
customSettings.postgresql.sqlany-
customSettings.prologany-
customSettings.prolog.plany-
customSettings.pugany-
customSettings.purgecssany-
customSettings.pyany-
customSettings.py-wasmany-
customSettings.py3any-
customSettings.pyodideany-
customSettings.pythonany-
customSettings.python-wasmany-
customSettings.pythonwasmany-
customSettings.pywasmany-
customSettings.rany-
customSettings.r-wasmany-
customSettings.rbany-
customSettings.reany-
customSettings.react-nativeany-
customSettings.react-native-tsxany-
customSettings.react-native.jsxany-
customSettings.react-native.tsxany-
customSettings.reasonany-
customSettings.reiany-
customSettings.resany-
customSettings.rescriptany-
customSettings.resiany-
customSettings.richany-
customSettings.richtextany-
customSettings.riotany-
customSettings.riotjsany-
customSettings.rlangany-
customSettings.rstatsany-
customSettings.rteany-
customSettings.rte.htmlany-
customSettings.rubyany-
customSettings.ruby-wasmany-
customSettings.rubywasmany-
customSettings.sassany-
customSettings.schemeany-
customSettings.scmany-
customSettings.scriptType?"" | "module" | "text/liquid" | "text/python" | "text/r" | "text/ruby-wasm" | "text/x-uniter-php" | "text/php-wasm" | "text/cpp" | "text/perl" | "text/julia" | "text/biwascheme" | "text/commonlisp" | "text/tcl" | "text/prolog" | "application/json" | "application/lua" | "text/fennel" | "application/wasm-uint8" | "application/javascript" | "application/ecmascript" | "text/javascript" | "text/ecmascript"-
customSettings.scssany-
customSettings.solidany-
customSettings.solid.jsxany-
customSettings.solid.tsxany-
customSettings.sqlany-
customSettings.sqliteany-
customSettings.sqlite3any-
customSettings.stencilany-
customSettings.stencil.tsxany-
customSettings.stylany-
customSettings.stylisany-
customSettings.stylusany-
customSettings.sucraseany-
customSettings.svelteany-
customSettings.tailwindcssany-
customSettings.tclany-
customSettings.tealany-
customSettings.template?{ data?: any ; prerender?: boolean }-
customSettings.template.data?any-
customSettings.template.prerender?boolean-
customSettings.tlany-
customSettings.tokencssany-
customSettings.tsany-
customSettings.tsxany-
customSettings.twigany-
customSettings.types?Types-
customSettings.typescriptany-
customSettings.unocssany-
customSettings.ventoany-
customSettings.vtoany-
customSettings.vueany-
customSettings.vue2any-
customSettings.vue3any-
customSettings.wasmany-
customSettings.wasm.cppany-
customSettings.wasm.luaany-
customSettings.wasm.phpany-
customSettings.wasm.pyany-
customSettings.wasm.rbany-
customSettings.wastany-
customSettings.watany-
customSettings.webassemblyany-
customSettings.windicssany-
customSettings.xhtany-
customSettings.xmlany-
cwasmundefined | string-
cwasm-selectorundefined | string-
cxxundefined | string-
cxx-selectorundefined | string-
delay?numberTime delay (in milliseconds) following code change, after which the result page is updated (if autoupdate is true) and/or the project is saved (if autosave is true). Default ts 1500
description?stringProject description. Used in project search and result page description meta tag. Default ts ""
diagramundefined | string-
diagram-selectorundefined | string-
diagramsundefined | string-
diagrams-selectorundefined | string-
disableAI?boolean-
dotundefined | string-
dot-selectorundefined | string-
editor?"monaco" | "codemirror" | "codejar"Selects the code editor to use. If undefined (the default), Monaco editor is used on desktop, CodeMirror is used on mobile and CodeJar is used in codeblocks, in lite mode and in readonly playgrounds. Default ts undefined
editorMode?"vim" | "emacs"Sets editor mode.
editorTheme?string | EditorTheme[]Sets the code editor themes. See docs for editor themes for details. Example ts "vs" Example ts "monaco:twilight, codemirror:one-dark" Example ts ["vs@light"] Example ts ["vs@light", "vs-dark@dark"] Example ts ["monaco:vs@light", "codemirror:github-light@light", "dracula@dark"]
ednundefined | string-
edn-selectorundefined | string-
ejsundefined | string-
ejs-selectorundefined | string-
embed?boolean-
emmet?booleanEnables Emmet. Default ts true
enableAI?booleanIf true, AI code assistant is enabled. Default ts false
esundefined | string-
es-selectorundefined | string-
etaundefined | string-
eta-selectorundefined | string-
fennelundefined | string-
fennel-selectorundefined | string-
files?string-
flowundefined | string-
flow-selectorundefined | string-
fnlundefined | string-
fnl-selectorundefined | string-
fontFamily?stringSets the code editor font family.
fontSize?numberSets the font size. If undefined (the default), the font size is set to 14 for the full app and 12 for embeds. Default ts undefined
formatOnsave?booleanIf true, the code is automatically formatted on saving the project. Default ts false
gleamundefined | string-
gleam-selectorundefined | string-
goundefined | string-
go-selectorundefined | string-
golangundefined | string-
golang-selectorundefined | string-
graphundefined | string-
graph-selectorundefined | string-
hundefined | string-
h-selectorundefined | string-
hamlundefined | string-
haml-selectorundefined | string-
handlebarsundefined | string-
handlebars-selectorundefined | string-
hbsundefined | string-
hbs-selectorundefined | string-
head?stringContent added to the result page <head> element. Default ts '<meta charset="UTF-8" />\n<meta name="viewport" content="width=device-width, initial-scale=1.0" />'
hppundefined | string-
hpp-selectorundefined | string-
htmundefined | string-
htm-selectorundefined | string-
htmlundefined | string-
html-selectorundefined | string-
htmlAttrs?string | Record<string, string>Attributes added to the result page <html> element. It can be an object or a string. Example ts { lang: "en", class: "dark" } 'lang="en" class="dark"'
iiundefined | string-
ii-selectorundefined | string-
imbaundefined | string-
imba-selectorundefined | string-
import?stringA resource to import (from any of the supported sources).
imports?{ [key: string]: string; }Allows specifying custom import maps for module imports. Example Setting imports like this: js "imports": { "moment": "https://cdn.jsdelivr.net/npm/[email protected]/dist/moment.js" } results in the following import map: html <script type="importmap"> { "imports": { "moment": "https://cdn.jsdelivr.net/npm/[email protected]/dist/moment.js" } } </script> See docs for Imports and Custom Module Resolution
ixxundefined | string-
ixx-selectorundefined | string-
jadeundefined | string-
jade-selectorundefined | string-
javascriptundefined | string-
javascript-selectorundefined | string-
jlundefined | string-
jl-selectorundefined | string-
jsundefined | string-
js-selectorundefined | string-
jsonundefined | string-
json-selectorundefined | string-
jsxundefined | string-
jsx-selectorundefined | string-
juliaundefined | string-
julia-selectorundefined | string-
lang?Language-
language?Language-
languages?string-
layout?"horizontal" | "vertical" | "responsive"Sets the app layout to horizontal or vertical. If set to "responsive" (the default) or undefined, the layout is vertical in small screens when the playground height is larger than its width, otherwise horizontal. Default ts "responsive"
lessundefined | string-
less-selectorundefined | string-
lineNumbers?booleanShow line numbers in code editor. Default ts true
liquidundefined | string-
liquid-selectorundefined | string-
liquidjsundefined | string-
liquidjs-selectorundefined | string-
lispundefined | string-
lisp-selectorundefined | string-
lite?booleanIf true, the playground is loaded in lite mode.
livescriptundefined | string-
livescript-selectorundefined | string-
loading?"click" | "eager" | "lazy"Sets how the playground loads: - "eager": The playground loads immediately. - "lazy": A playground embedded low down in the page will not load until the user scrolls so that it approaches the viewport. - "click": The playground does not load automatically. Instead, a "Click-to-load" screen is shown. Default ts "lazy"
lsundefined | string-
ls-selectorundefined | string-
luaundefined | string-
lua-selectorundefined | string-
lua-wasmundefined | string-
lua-wasm-selectorundefined | string-
luawasmundefined | string-
luawasm-selectorundefined | string-
malinaundefined | string-
malina-selectorundefined | string-
malinajsundefined | string-
malinajs-selectorundefined | string-
markdownundefined | string-
markdown-selectorundefined | string-
markup?{ content?: string ; contentUrl?: string ; hiddenContent?: string ; hiddenContentUrl?: string ; language: Language ; position?: EditorPosition ; selector?: string ; title?: string }An object that configures the language and content of the markup editor. See docs for details. Default ts { language: "html", content: "" }
markup.content?stringThe initial content of the code editor. Default ts ""
markup.contentUrl?stringA URL to load content from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if content property had no value.
markup.hiddenContent?stringHidden content that gets evaluated without being visible in the code editor. This can be useful in embedded playgrounds (e.g. for adding helper functions, utilities or tests)
markup.hiddenContentUrl?stringA URL to load hiddenContent from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if hiddenContent property had no value.
markup.languageLanguageA language name, extension or alias (as defined in language documentations). For the list of supported values, see Language
markup.position?EditorPositionThe initial position of the cursor in the code editor. Example ts {lineNumber: 5, column: 10}
markup.selector?stringA CSS selector to load content from DOM import.
markup.title?stringIf set, this is used as the title of the editor in the UI, overriding the default title set to the language name (e.g. "Python" can be used instead of "Py (Wasm)").
mdundefined | string-
md-selectorundefined | string-
mdownundefined | string-
mdown-selectorundefined | string-
mdxundefined | string-
mdx-selectorundefined | string-
mjmlundefined | string-
mjml-selectorundefined | string-
mkdnundefined | string-
mkdn-selectorundefined | string-
mlundefined | string-
ml-selectorundefined | string-
mliundefined | string-
mli-selectorundefined | string-
mode?"focus" | "full" | "result" | "editor" | "simple" | "codeblock"Sets the display mode. Default ts "full"
mustacheundefined | string-
mustache-selectorundefined | string-
new?""-
njkundefined | string-
njk-selectorundefined | string-
no-defaults?boolean-
nunjucksundefined | string-
nunjucks-selectorundefined | string-
ocamlundefined | string-
ocaml-selectorundefined | string-
params?{ appUrl?: string | undefined; params?: ... | undefined; config?: string | (Partial<Config> & string) | undefined; import?: string | undefined; lite?: boolean | undefined; ... 442 more ...; compiled?: "" | ... 5 more ... | undefined; } | undefinedAn object that represents the URL Query parameters, that can be used to configure the playground. These 2 snippets produce similar output: js import { createPlayground } from 'livecodes'; // use config createPlayground('#container', { config: { markup: { language: 'markdown', content: '# Hello World!', }, }, }); // use params createPlayground('#container', { params: { md: '# Hello World!' } });
perlundefined | string-
perl-selectorundefined | string-
pgundefined | string-
pg-selectorundefined | string-
pg.sqlundefined | string-
pg.sql-selectorundefined | string-
pgliteundefined | string-
pglite-selectorundefined | string-
pglite.sqlundefined | string-
pglite.sql-selectorundefined | string-
pgsqlundefined | string-
pgsql-selectorundefined | string-
pgsql.sqlundefined | string-
pgsql.sql-selectorundefined | string-
phpundefined | string-
php-selectorundefined | string-
php-wasmundefined | string-
php-wasm-selectorundefined | string-
phpwasmundefined | string-
phpwasm-selectorundefined | string-
pintoraundefined | string-
pintora-selectorundefined | string-
plundefined | string-
pl-selectorundefined | string-
pltundefined | string-
plt-selectorundefined | string-
pmundefined | string-
pm-selectorundefined | string-
postcssundefined | string-
postcss-selectorundefined | string-
postgre.sqlundefined | string-
postgre.sql-selectorundefined | string-
postgresundefined | string-
postgres-selectorundefined | string-
postgresqlundefined | string-
postgresql-selectorundefined | string-
postgresql.sqlundefined | string-
postgresql.sql-selectorundefined | string-
preview?boolean-
processors?string-
prologundefined | string-
prolog-selectorundefined | string-
prolog.plundefined | string-
prolog.pl-selectorundefined | string-
pugundefined | string-
pug-selectorundefined | string-
pyundefined | string-
py-selectorundefined | string-
py-wasmundefined | string-
py-wasm-selectorundefined | string-
py3undefined | string-
py3-selectorundefined | string-
pyodideundefined | string-
pyodide-selectorundefined | string-
pythonundefined | string-
python-selectorundefined | string-
python-wasmundefined | string-
python-wasm-selectorundefined | string-
pythonwasmundefined | string-
pythonwasm-selectorundefined | string-
pywasmundefined | string-
pywasm-selectorundefined | string-
rundefined | string-
r-selectorundefined | string-
r-wasmundefined | string-
r-wasm-selectorundefined | string-
raw?Language-
rbundefined | string-
rb-selectorundefined | string-
reundefined | string-
re-selectorundefined | string-
react-nativeundefined | string-
react-native-selectorundefined | string-
react-native-tsxundefined | string-
react-native-tsx-selectorundefined | string-
react-native.jsxundefined | string-
react-native.jsx-selectorundefined | string-
react-native.tsxundefined | string-
react-native.tsx-selectorundefined | string-
readonly?booleanIf true, editors are loaded in read-only mode, where the user is not allowed to change the code. By default, when readonly is set to true, the light-weight code editor CodeJar is used. If you wish to use another editor, set the editor property. Default ts false
reasonundefined | string-
reason-selectorundefined | string-
recoverUnsaved?booleanEnables recovering last unsaved project when the app is reopened. Default ts true
reiundefined | string-
rei-selectorundefined | string-
resundefined | string-
res-selectorundefined | string-
rescriptundefined | string-
rescript-selectorundefined | string-
resiundefined | string-
resi-selectorundefined | string-
richundefined | string-
rich-selectorundefined | string-
richtextundefined | string-
richtext-selectorundefined | string-
riotundefined | string-
riot-selectorundefined | string-
riotjsundefined | string-
riotjs-selectorundefined | string-
rlangundefined | string-
rlang-selectorundefined | string-
rstatsundefined | string-
rstats-selectorundefined | string-
rteundefined | string-
rte-selectorundefined | string-
rte.htmlundefined | string-
rte.html-selectorundefined | string-
rubyundefined | string-
ruby-selectorundefined | string-
ruby-wasmundefined | string-
ruby-wasm-selectorundefined | string-
rubywasmundefined | string-
rubywasm-selectorundefined | string-
sassundefined | string-
sass-selectorundefined | string-
schemeundefined | string-
scheme-selectorundefined | string-
scmundefined | string-
scm-selectorundefined | string-
screen?"new" | "open" | "embed" | "sync" | "about" | "welcome" | "add-snippet" | "login" | "info" | "assets" | "add-asset" | "snippets" | "import" | "resources" | "share" | "deploy" | "backup" | "broadcast" | "custom-settings" | "editor-settings" | "test-editor"-
script?{ content?: string ; contentUrl?: string ; hiddenContent?: string ; hiddenContentUrl?: string ; language: Language ; position?: EditorPosition ; selector?: string ; title?: string }An object that configures the language and content of the script editor. See docs for details. Default ts { language: "javascript", content: "" }
script.content?stringThe initial content of the code editor. Default ts ""
script.contentUrl?stringA URL to load content from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if content property had no value.
script.hiddenContent?stringHidden content that gets evaluated without being visible in the code editor. This can be useful in embedded playgrounds (e.g. for adding helper functions, utilities or tests)
script.hiddenContentUrl?stringA URL to load hiddenContent from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if hiddenContent property had no value.
script.languageLanguageA language name, extension or alias (as defined in language documentations). For the list of supported values, see Language
script.position?EditorPositionThe initial position of the cursor in the code editor. Example ts {lineNumber: 5, column: 10}
script.selector?stringA CSS selector to load content from DOM import.
script.title?stringIf set, this is used as the title of the editor in the UI, overriding the default title set to the language name (e.g. "Python" can be used instead of "Py (Wasm)").
scripts?string-
scrollPosition?boolean-
scssundefined | string-
scss-selectorundefined | string-
semicolons?booleanConfigures Prettier code formatter to use semi-colons. Default ts true
showSpacing?booleanEnables showing element spacing in the result page. Default ts false
singleQuote?booleanConfigures Prettier code formatter to use single quotes instead of double quotes. Default ts false
solidundefined | string-
solid-selectorundefined | string-
solid.jsxundefined | string-
solid.jsx-selectorundefined | string-
solid.tsxundefined | string-
solid.tsx-selectorundefined | string-
sqlundefined | string-
sql-selectorundefined | string-
sqliteundefined | string-
sqlite-selectorundefined | string-
sqlite3undefined | string-
sqlite3-selectorundefined | string-
stencilundefined | string-
stencil-selectorundefined | string-
stencil.tsxundefined | string-
stencil.tsx-selectorundefined | string-
stylundefined | string-
styl-selectorundefined | string-
style?{ content?: string ; contentUrl?: string ; hiddenContent?: string ; hiddenContentUrl?: string ; language: Language ; position?: EditorPosition ; selector?: string ; title?: string }An object that configures the language and content of the style editor. See docs for details. Default ts { language: "css", content: "" }
style.content?stringThe initial content of the code editor. Default ts ""
style.contentUrl?stringA URL to load content from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if content property had no value.
style.hiddenContent?stringHidden content that gets evaluated without being visible in the code editor. This can be useful in embedded playgrounds (e.g. for adding helper functions, utilities or tests)
style.hiddenContentUrl?stringA URL to load hiddenContent from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if hiddenContent property had no value.
style.languageLanguageA language name, extension or alias (as defined in language documentations). For the list of supported values, see Language
style.position?EditorPositionThe initial position of the cursor in the code editor. Example ts {lineNumber: 5, column: 10}
style.selector?stringA CSS selector to load content from DOM import.
style.title?stringIf set, this is used as the title of the editor in the UI, overriding the default title set to the language name (e.g. "Python" can be used instead of "Py (Wasm)").
stylesheets?string-
stylisundefined | string-
stylis-selectorundefined | string-
stylusundefined | string-
stylus-selectorundefined | string-
sucraseundefined | string-
sucrase-selectorundefined | string-
svelteundefined | string-
svelte-selectorundefined | string-
tabSize?numberThe number of spaces per indentation-level. Also used in code formatting. Default ts 2
tags?string | string[]-
tclundefined | string-
tcl-selectorundefined | string-
tealundefined | string-
teal-selectorundefined | string-
template?TemplateNameA starter template to load. Allowed valued can be found here.
tests?({ language?: Language | undefined; title?: string | undefined; content?: string | undefined; contentUrl?: string | undefined; hiddenContent?: string | undefined; hiddenContentUrl?: string | undefined; selector?: string | undefined; position?: EditorPosition | undefined; } | undefined) & ("" | ... 4 more ... | "true")Configures the language and content of tests.
theme?ThemeSets the app theme to light/dark mode. Default ts "dark"
themeColor?stringSets the app theme color. If undefined, it is set to "hsl(214, 40%, 50%)". Default ts undefined
title?stringProject title. This is used as result page title and title meta tag. Also used in project search. Default ts "Untitled Project"
tlundefined | string-
tl-selectorundefined | string-
tools?"none" | "closed" | "open" | "full" | "console" | "compiled" | "tests" | "console\|undefined" | "console\|" | "console\|none" | "console\|closed" | "console\|open" | "console\|full" | "compiled\|undefined" | "compiled\|" | "compiled\|none" | "compiled\|closed" | "compiled\|open" | "compiled\|full" | "tests\|undefined" | "tests\|" | "tests\|none" | "tests\|closed" | "tests\|open" | "tests\|full" | "console,console\|undefined" | "console,console\|" | "console,console\|none" | "console,console\|closed" | "console,console\|open" | "console,console\|full" | "console,compiled\|undefined" | "console,compiled\|" | "console,compiled\|none" | "console,compiled\|closed" | "console,compiled\|open" | "console,compiled\|full" | "console,tests\|undefined" | "console,tests\|" | "console,tests\|none" | "console,tests\|closed" | "console,tests\|open" | "console,tests\|full" | "compiled,console\|undefined" | "compiled,console\|" | "compiled,console\|none" | "compiled,console\|closed" | "compiled,console\|open" | "compiled,console\|full" | "compiled,compiled\|undefined" | "compiled,compiled\|" | "compiled,compiled\|none" | "compiled,compiled\|closed" | "compiled,compiled\|open" | "compiled,compiled\|full" | "compiled,tests\|undefined" | "compiled,tests\|" | "compiled,tests\|none" | "compiled,tests\|closed" | "compiled,tests\|open" | "compiled,tests\|full" | "tests,console\|undefined" | "tests,console\|" | "tests,console\|none" | "tests,console\|closed" | "tests,console\|open" | "tests,console\|full" | "tests,compiled\|undefined" | "tests,compiled\|" | "tests,compiled\|none" | "tests,compiled\|closed" | "tests,compiled\|open" | "tests,compiled\|full" | "tests,tests\|undefined" | "tests,tests\|" | "tests,tests\|none" | "tests,tests\|closed" | "tests,tests\|open" | "tests,tests\|full" | "console,console,console\|undefined" | "console,console,console\|" | "console,console,console\|none" | "console,console,console\|closed" | "console,console,console\|open" | "console,console,console\|full" | "console,console,compiled\|undefined" | "console,console,compiled\|" | "console,console,compiled\|none" | "console,console,compiled\|closed" | "console,console,compiled\|open" | "console,console,compiled\|full" | "console,console,tests\|undefined" | "console,console,tests\|" | "console,console,tests\|none" | "console,console,tests\|closed" | "console,console,tests\|open" | "console,console,tests\|full" | "console,compiled,console\|undefined" | "console,compiled,console\|" | "console,compiled,console\|none" | "console,compiled,console\|closed" | "console,compiled,console\|open" | "console,compiled,console\|full" | "console,compiled,compiled\|undefined" | "console,compiled,compiled\|" | "console,compiled,compiled\|none" | "console,compiled,compiled\|closed" | "console,compiled,compiled\|open" | "console,compiled,compiled\|full" | "console,compiled,tests\|undefined" | "console,compiled,tests\|" | "console,compiled,tests\|none" | "console,compiled,tests\|closed" | "console,compiled,tests\|open" | "console,compiled,tests\|full" | "console,tests,console\|undefined" | "console,tests,console\|" | "console,tests,console\|none" | "console,tests,console\|closed" | "console,tests,console\|open" | "console,tests,console\|full" | "console,tests,compiled\|undefined" | "console,tests,compiled\|" | "console,tests,compiled\|none" | "console,tests,compiled\|closed" | "console,tests,compiled\|open" | "console,tests,compiled\|full" | "console,tests,tests\|undefined" | "console,tests,tests\|" | "console,tests,tests\|none" | "console,tests,tests\|closed" | "console,tests,tests\|open" | "console,tests,tests\|full" | "compiled,console,console\|undefined" | "compiled,console,console\|" | "compiled,console,console\|none" | "compiled,console,console\|closed" | "compiled,console,console\|open" | "compiled,console,console\|full" | "compiled,console,compiled\|undefined" | "compiled,console,compiled\|" | "compiled,console,compiled\|none" | "compiled,console,compiled\|closed" | "compiled,console,compiled\|open" | "compiled,console,compiled\|full" | "compiled,console,tests\|undefined" | "compiled,console,tests\|" | "compiled,console,tests\|none" | "compiled,console,tests\|closed" | "compiled,console,tests\|open" | "compiled,console,tests\|full" | "compiled,compiled,console\|undefined" | "compiled,compiled,console\|" | "compiled,compiled,console\|none" | "compiled,compiled,console\|closed" | "compiled,compiled,console\|open" | "compiled,compiled,console\|full" | "compiled,compiled,compiled\|undefined" | "compiled,compiled,compiled\|" | "compiled,compiled,compiled\|none" | "compiled,compiled,compiled\|closed" | "compiled,compiled,compiled\|open" | "compiled,compiled,compiled\|full" | "compiled,compiled,tests\|undefined" | "compiled,compiled,tests\|" | "compiled,compiled,tests\|none" | "compiled,compiled,tests\|closed" | "compiled,compiled,tests\|open" | "compiled,compiled,tests\|full" | "compiled,tests,console\|undefined" | "compiled,tests,console\|" | "compiled,tests,console\|none" | "compiled,tests,console\|closed" | "compiled,tests,console\|open" | "compiled,tests,console\|full" | "compiled,tests,compiled\|undefined" | "compiled,tests,compiled\|" | "compiled,tests,compiled\|none" | "compiled,tests,compiled\|closed" | "compiled,tests,compiled\|open" | "compiled,tests,compiled\|full" | "compiled,tests,tests\|undefined" | "compiled,tests,tests\|" | "compiled,tests,tests\|none" | "compiled,tests,tests\|closed" | "compiled,tests,tests\|open" | "compiled,tests,tests\|full" | "tests,console,console\|undefined" | "tests,console,console\|" | "tests,console,console\|none" | "tests,console,console\|closed" | "tests,console,console\|open" | "tests,console,console\|full" | "tests,console,compiled\|undefined" | "tests,console,compiled\|" | "tests,console,compiled\|none" | "tests,console,compiled\|closed" | "tests,console,compiled\|open" | "tests,console,compiled\|full" | "tests,console,tests\|undefined" | "tests,console,tests\|" | "tests,console,tests\|none" | "tests,console,tests\|closed" | "tests,console,tests\|open" | "tests,console,tests\|full" | "tests,compiled,console\|undefined" | "tests,compiled,console\|" | "tests,compiled,console\|none" | "tests,compiled,console\|closed" | "tests,compiled,console\|open" | "tests,compiled,console\|full" | "tests,compiled,compiled\|undefined" | "tests,compiled,compiled\|" | "tests,compiled,compiled\|none" | "tests,compiled,compiled\|closed" | "tests,compiled,compiled\|open" | "tests,compiled,compiled\|full" | "tests,compiled,tests\|undefined" | "tests,compiled,tests\|" | "tests,compiled,tests\|none" | "tests,compiled,tests\|closed" | "tests,compiled,tests\|open" | "tests,compiled,tests\|full" | "tests,tests,console\|undefined" | "tests,tests,console\|" | "tests,tests,console\|none" | "tests,tests,console\|closed" | "tests,tests,console\|open" | "tests,tests,console\|full" | "tests,tests,compiled\|undefined" | "tests,tests,compiled\|" | "tests,tests,compiled\|none" | "tests,tests,compiled\|closed" | "tests,tests,compiled\|open" | "tests,tests,compiled\|full" | "tests,tests,tests\|undefined" | "tests,tests,tests\|" | "tests,tests,tests\|none" | "tests,tests,tests\|closed" | "tests,tests,tests\|open" | "tests,tests,tests\|full"-
trailingComma?booleanConfigures Prettier code formatter to use trailing commas. Default ts true
tsundefined | string-
ts-selectorundefined | string-
tsxundefined | string-
tsx-selectorundefined | string-
twigundefined | string-
twig-selectorundefined | string-
types?{}Allows providing custom TypeScript type declarations for better editor intellisense. It is an object where each key represents module name and value represents the types. See docs for Types and Custom Types Example js { "types": { "my-demo-lib": "https://my-custom-domain/my-type-declarations.d.ts" } } Example { "types": { "my-demo-lib": { "url": "https://my-custom-domain/types.d.ts", "autoload": true, "declareAsModule": true } }
typescriptundefined | string-
typescript-selectorundefined | string-
useTabs?booleanIf true, lines are indented with tabs instead of spaces. Also used in code formatting. Default ts false
ventoundefined | string-
vento-selectorundefined | string-
version?stringThis is a read-only property which specifies the current LiveCodes version. Version specified in exported projects allows automatically upgrading the project configuration when imported by an app with a newer version.
view?"split" | "result" | "editor" | "headless"The default view for the playground. When set to "headless", the playground is loaded in headless mode.
vtoundefined | string-
vto-selectorundefined | string-
vueundefined | string-
vue-selectorundefined | string-
vue2undefined | string-
vue2-selectorundefined | string-
vue3undefined | string-
vue3-selectorundefined | string-
wasmundefined | string-
wasm-selectorundefined | string-
wasm.cppundefined | string-
wasm.cpp-selectorundefined | string-
wasm.luaundefined | string-
wasm.lua-selectorundefined | string-
wasm.phpundefined | string-
wasm.php-selectorundefined | string-
wasm.pyundefined | string-
wasm.py-selectorundefined | string-
wasm.rbundefined | string-
wasm.rb-selectorundefined | string-
wastundefined | string-
wast-selectorundefined | string-
watundefined | string-
wat-selectorundefined | string-
webassemblyundefined | string-
webassembly-selectorundefined | string-
welcome?booleanIf true, the welcome screen is displayed when the app loads.
wordWrap?booleanEnables word-wrap for long lines. Default ts false
x?string-
xhtundefined | string-
xht-selectorundefined | string-
xmlundefined | string-
xml-selectorundefined | string-
zoom?1 | 0.5 | 0.25Sets result page zoom level.

Defined in

models.ts:338


template

Optional template: TemplateName

A starter template to load. Allowed valued can be found here.

Defined in

models.ts:373


view

Optional view: "split" | "result" | "editor" | "headless"

The default view for the playground.

When set to "headless", the playground is loaded in headless mode.

Defined in

models.ts:380