I built /ai inside a notes app — here's how I render generated UI components safely

TL;DR AI
2 min readKey summary
A developer added a /ai command to a Tiptap notes app to generate interactive UI components directly inside the document.
The app streams HTML, CSS, and JS into a node, stores the result in Supabase, and renders it only after completion.
The generated UI runs in a sandboxed iframe with Tailwind loaded from a CDN, helping limit security risk.
The setup shows a practical way to embed AI-built tools inline in notes while reducing context switching.
