widget
functionDeclare a floating surface: a heads-up panel, an overlay, or a detached window of its own. Same runtime as `view`. The component is a module reference the host mounts in a sandboxed renderer webview, with no Node access, talking to the ext-host half of the mod through `ctx.action(...)` and shared state. The difference is placement and framing. A widget is not a container panel: it sits in a widget slot or detaches into a window of its own, and it carries its own size bounds, frame, transparency, and always-on-top behaviour. It can be opened by a command or a socket trigger. Docked panel, use `view`. Anything that floats over the workbench or detaches into a separate window, use `widget`. For UI that lives inside a document rather than on top of it, use `editorExtension` or `canvasElement`, which run renderer-native rather than over RPC.
Import
import { widget } from '@modular/sdk';Notes
- category
- Authoring