widget-iframe-overlay

A set of rules for floating widgets that contain or sit beside iframes. An iframe is a webpage embedded inside another webpage.

In plain words
What is it for?
Use it when adding close buttons, controlling widget visibility as sections enter view, or moving a widget between screen corners.
Why use it?
A high z-index does not reliably place a widget above an iframe, and an always-visible widget can cover unrelated content.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/dmenchaca/webflow-to-react/widget-iframe-overlay
Clone the repo
git clone --depth 1 https://github.com/dmenchaca/webflow-to-react
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 496 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00496
Opus 5 $0.00000 $0.00248
Sonnet 5 $0.00000 $0.00099
Haiku 4.5 $0.00000 $0.00050

Measured 2d ago against content hash 48aad9d423ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

widget-iframe-overlay scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/widget-iframe-overlay.mdc · 44 lines

What it actually says

Floating widgets + iframes

Z-index doesn't beat iframes

Iframes are separate compositor surfaces. Floating a button on top of one with just z-index: 999 is unreliable across browsers and device modes.

Fix: reserve layout space for the overlay control (e.g. padding-top or margin-bottom on the container above the iframe) so the close button has its own box. Use an explicit class like .widget-container--with-close instead of CSS :has() for the layout variant — :has() support is spotty in older Safari/WebViews.

Visibility via IntersectionObserver, not "always visible"

Tie widget visibility to a specific anchor section's id using IntersectionObserver (or Framer Motion useInView). Never render floating widgets unconditionally.

Corner-snap docking: explicit state machine

If the widget snaps to screen corners, model allowed transitions explicitly:

type Corner = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'
const NEIGHBORS: Record<Corner, Corner[]> = {
  topLeft: ['topRight', 'bottomLeft'],
  topRight: ['topLeft', 'bottomRight'],
  bottomLeft: ['topLeft', 'bottomRight'],
  bottomRight: ['topRight', 'bottomLeft'],
}

No diagonals, no implicit "closest corner" logic — it makes arrow controls inconsistent.

Dismissal state

Default to component-local state (dismissal resets when the user scrolls away from the anchor section and back). That matches most UX expectations.

If you add localStorage persistence, document it clearly in the component and ideally in claude.md — users otherwise report it as "the widget is broken, it won't come back."

Don't combine color transitions with blur reveals

If the design calls for backdrop-filter: blur() to reveal a CTA on hover (typical for logo grids), don't also animate background-color on the same surface. The color shift reads as a separate visual bug on top of the blur effect.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 44 lines · 0 tokens per session scan A 48aad9d423ba

Subscribe to this mod's changes

widget-iframe-overlay is a cursor rule published in the GitHub repository dmenchaca/webflow-to-react (27 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 496 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.