Skip to main content

Widget

Declare kind: "widget" and a slot ending in .widget, then register the body component. The host supplies the frame, drag handle, remove control and resizing.

Registration metadata

widget optionMeaning
titleHeader, palette and drag-preview title
zonePreferred initial placement zone
heightInitial fixed height in pixels
minHeightResize floor
heightModefixed or fill
frametile by default; none when the plugin supplies its own frame

Without metadata, the title falls back to the registration key or plugin ID, the default height is 260px and the default cockpit placement is the left rail. The existing cockpit zone IDs are gauche and droite; they are placement identifiers, not translated UI text.

These defaults apply only on first placement. The user's saved layout takes precedence afterward. A preferred zone that is not mounted can leave the card waiting for that zone.

Multiple instances

Placement is identified by plugin ID plus registration key. Give each instance a stable, distinct key. Do not derive it from a mutable label or agent name. To change a registration title, dispose and re-register under the same key; its placement remains associated with that key.

If instance configuration arrives asynchronously, clean up its subscription when the plugin unloads. Otherwise a disabled plugin can accidentally register its cards again.

Supplying your own frame

Choose frame: 'none' only when the header needs custom content. The host passes poignee (layout controls), className (including height classes) and optional editing. Render the controls in your header and forward className to the root. Propagate the host's full-height class for a fill-mode widget.

Do not create another drag context or duplicate the host's palette. The UI kit provides Tile for a custom frame. The supplied plugin-widget is the simplest starting point.