The JS Field is used to custom render content in a field's position using JavaScript. It is commonly used in details blocks, read-only items in forms, or as "Other custom items" in table columns. It is suitable for personalized displays, combining derived information, rendering status badges, rich text, or charts.

ctx.value to render output.ctx.getValue()/ctx.setValue(v) and a container event js-field:value-change to facilitate two-way synchronization with form values.Read-only
Editable
The JS Field runtime code can directly use the following context capabilities:
ctx.element: The field's DOM container (ElementProxy), supporting innerHTML, querySelector, addEventListener, etc.ctx.value: The current field value (read-only).ctx.record: The current record object (read-only).ctx.collection: Metadata of the collection to which the field belongs (read-only).ctx.requireAsync(url): Asynchronously load an AMD/UMD library by URL.ctx.importAsync(url): Dynamically import an ESM module by URL.ctx.openView(options): Open a configured view (popup/drawer/page).ctx.i18n.t() / ctx.t(): Internationalization.ctx.onRefReady(ctx.ref, cb): Render after the container is ready.ctx.libs.React / ctx.libs.ReactDOM / ctx.libs.antd / ctx.libs.antdIcons / ctx.libs.dayjs: Built-in React, ReactDOM, Ant Design, Ant Design icons, and dayjs libraries for JSX rendering and date-time utilities. (ctx.React / ctx.ReactDOM / ctx.antd are kept for compatibility.)ctx.render(vnode): Renders a React element, HTML string, or DOM node into the default container ctx.element. Repeated rendering will reuse the Root and overwrite the existing content of the container.Specific to Editable type (JSEditableField):
ctx.getValue(): Get the current form value (prioritizes form state, then falls back to field props).ctx.setValue(v): Set the form value and field props, maintaining two-way synchronization.js-field:value-change: Triggered when an external value changes, making it easy for the script to update the input display.The JS Field script editor supports syntax highlighting, error hints, and built-in code snippets.
Snippets: Opens a list of built-in code snippets, which can be searched and inserted at the current cursor position with one click.Run: Directly executes the current code. The execution log is output to the Logs panel at the bottom, supporting console.log/info/warn/error and error highlighting for easy location.
You can also generate code with the AI Employee:
if (!lib) return;).class or [name=...] for selectors and avoid using fixed ids to prevent duplicate ids in multiple blocks or popups.