Config interface represents the playground configuration object. It holds the configuration and state of the playground and is composed of three main parts: content configuration, app configuration, and user configuration.
Overview
Content Configuration
Properties that define the content of the current project.title
Project title. Used as result page title and title meta tag. Also used in project search.
description
Project description. Used in project search and result page description meta tag.
head
Content added to the result page
<head> element.htmlAttrs
Attributes added to the result page
<html> element. Can be an object or a string.tags
Project tags. Used in project filter and search.
activeEditor
Selects the active editor to show. Defaults to the last used editor for user, otherwise
"markup".languages
List of enabled languages. Defaults to all supported languages in full app and only current editor languages in embeds.
markup
An object that configures the language and content of the markup editor.See Editor Configuration for details.
style
An object that configures the language and content of the style editor.See Editor Configuration for details.
script
An object that configures the language and content of the script editor.See Editor Configuration for details.
stylesheets
List of URLs for external stylesheets to add to the result page.
scripts
List of URLs for external scripts to add to the result page.
cssPreset
CSS Preset to use.
processors
List of enabled CSS processors.Available processors:
"postcss" | "postcssImportUrl" | "tailwindcss" | "windicss" | "unocss" | "tokencss" | "lightningcss" | "autoprefixer" | "postcssPresetEnv" | "cssmodules" | "purgecss" | "cssnano"customSettings
Defines custom settings for the current project.See Custom Settings documentation for details.
imports
Allows specifying custom import maps for module imports.
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.
tests
Configures the language and content of tests.See Tests documentation for details.
version
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.
App Configuration
Properties that define how the app behaves.readonly
If
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.allowLangChange
If
false, the UI will not show the menu that allows changing editor language.view
Sets the default view for the playground.
mode
Sets the display mode.
tools
Sets enabled and active tools and status of tools pane.See Tools Configuration for details.
zoom
Sets result page zoom level.
User Configuration
User preferences and editor settings.autoupdate
If
true, the result page is automatically updated on code change, after time delay.autosave
If
true, the project is automatically saved on code change, after time delay.autotest
If
true, the project is watched for code changes which trigger tests to auto-run.delay
Time 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).formatOnsave
If
true, the code is automatically formatted on saving the project.layout
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.recoverUnsaved
Enables recovering last unsaved project when the app is reopened.
showSpacing
Enables showing element spacing in the result page.
welcome
If
true, the welcome screen is displayed when the app loads.appLanguage
Sets the app UI language used.Available languages:
"auto" | "ar" | "bn" | "de" | "en" | "es" | "fa" | "fr" | "hi" | "id" | "it" | "ja" | "nl" | "pt" | "tr" | "ru" | "ur" | "zh-CN"Editor Settings
See Editor Configuration for detailed editor configuration options including:editor- Code editor to usetheme- App theme (light/dark)themeColor- App theme coloreditorTheme- Code editor themesfontFamily- Editor font familyfontSize- Editor font sizeuseTabs- Use tabs instead of spacestabSize- Spaces per indentationlineNumbers- Show line numberswordWrap- Enable word wrapfoldRegions- Fold regions on loadcloseBrackets- Auto-close bracketsminimap- Enable minimapemmet- Enable EmmeteditorMode- Editor mode (vim/emacs)
Formatter Settings
Configures Prettier code formatter to use semi-colons.
Configures Prettier code formatter to use single quotes instead of double quotes.
Configures Prettier code formatter to use trailing commas.