Dynamically load ESM modules or CSS by URL, for JS block, JS field, JS action, and similar scenarios. Use ctx.importAsync() for third-party ESM libraries; use ctx.requireAsync() for UMD/AMD libraries. Passing a .css URL loads and injects styles.
| Parameter | Type | Description |
|---|---|---|
url | string | ESM module or CSS URL. Supports shorthand <package>@<version> or with subpath <package>@<version>/<file> (e.g. vue@3.4.0, dayjs@1/plugin/relativeTime.js), resolved using the CDN base; full URLs are also supported. Passing a .css URL loads and injects styles. |
.css URL; it is loaded and injected into the page).vue@3.4.0 resolves to https://esm.sh/vue@3.4.0.https://esm.sh)/+esm for jsDelivr)ctx.importAsync().Demonstrates the most basic dynamic loading of ESM modules and CSS by package name or full URL.
Use ECharts to render a sales overview chart with bar and line series.
Render a data table with pagination and row click events in a block using Tabulator.
Load FullCalendar and its plugins via ESM and render a basic month-view calendar.
Minimal drag-and-drop example using @dnd-kit/core: drag a box into a drop zone inside a block.
This example uses only @dnd-kit/core, dragging a box into a zone to trigger a message, and shows the simplest drag interaction in RunJS with ctx.importAsync and React.
A vertical sortable list with drag-to-reorder using dnd-kit core, sortable, and utilities.
This example uses @dnd-kit/core, @dnd-kit/sortable, and @dnd-kit/utilities to build a sortable list that updates order on drag end and shows "List reordered".
Render a calendar component with events in the current block using react-big-calendar and date-fns localization.
Use frappe-gantt to render a Gantt view showing task start/end and progress.
Use @asseinfo/react-kanban to render a basic kanban with Backlog / Doing columns in a block.