Read-only source code with syntax highlighting, and optionally a copy button.
- Showing a stored snippet, query or payload where the highlighting and monospaced layout carry meaning.
- Displaying the SQL behind a saved report.
- Using it for ordinary prose — a Text Field or Markdown Field reads better.
- Using it where the user is meant to edit; that is a Code Input.
Use instead
- Code Input — Use instead when the code should be editable.
Configure these in the Application Designer property panel. Group headings mirror the editor where possible. Data Source is where the element gets its rows or field binding (a view/query, a connector operation, or a parent form field). References appear only for view-backed sources and map foreign-key ID columns to readable labels from another view.
- Configuration for value.Default: SELECT COUNT(*);
- Configuration for is Copy.Default: false
- Configuration for language.Default: sql
- Configuration for show Line Numbers.Default: none
- Configuration for theme.Choices
vsvscDarkPlusokaidiatomorrowcoycoyWithoutShadowsdarculadraculasolarizedlightsolarizedDarkAtommaterialLightmaterialDarkmaterialOceanica11yDarkatomDarkbase16AteliersulphurpoolLightcbcoldarkColdcoldarkDarkduotoneDarkduotoneLightduotoneEarthduotoneForestduotoneSeaduotoneSpaceghcolorsgruvboxDarkgruvboxLightholiThemehopscotchlucarionightOwlnordoneDarkoneLightpojoaqueshadesOfPurplesynthwave84twilightxonokaizTouch
Default: none
- No size of its own: dropped at the platform default of 1 × 1 grid cells and resized on the page.
Other parts of your app can read live values from this element in custom expressions:
elements.myCodeField.<property>
value
string
The current value.
elements.myCodeField.value
When The code currently displayed, if another element needs the same text.
To use one of these, open the property you want to drive on the other element, switch it to expression mode in the Expression Editor, and enter:
| |
Replace myCodeField with this element’s unique id. Select the element in Application Designer and copy the id chip at the top of the right-hand property panel.
Drag this element into one of these containers:
| |