Agent Skills: Incremental Mounting

Mount Vani components inside existing apps or DOM islands

UncategorizedID: itsjavi/vani/vani-incremental-mount

Install this agent skill to your local

pnpm dlx add-skill https://github.com/itsjavi/vani/tree/HEAD/skills/vani-incremental-mount

Skill Files

Browse the full folder contents for vani-incremental-mount.

Download Skill

Loading file tree…

skills/vani-incremental-mount/SKILL.md

Skill Metadata

Name
vani-incremental-mount
Description
Mount Vani components inside existing apps or DOM islands

Incremental Mounting

Instructions for embedding Vani components into existing applications via mount points.

When to Use

Use this when adding a Vani widget inside a non-Vani app or server-rendered page.

Steps

  1. Create a Vani component with explicit updates.
  2. Find or create a DOM mount node inside the host app.
  3. Call renderToDOM(Widget(), mountNode) (arrays also work) and store the returned handles.
  4. On host unmount/cleanup, call handle.dispose() for each handle.

Arguments

  • mountSelector - CSS selector or id for the mount point (defaults to #app)
  • componentName - name of the embedded component (defaults to Widget)
  • cleanupStrategy - how cleanup is triggered (defaults to onUnmount)

Examples

Example 1 usage pattern:

Embed a Vani counter inside a React or server-rendered page using a div mount node.

Example 2 usage pattern:

Create multiple independent widgets with separate mount points and dispose them on teardown.

Output

Example output:

Created: src/widget.ts
Updated: src/host-integration.ts
Notes: Handles are disposed when the host unmounts.

Present Results to User

Explain the mount point, how handles are stored and disposed, and list file changes.