Home / Function/ isElementInViewport() — supabase Function Reference

isElementInViewport() — supabase Function Reference

Architecture documentation for the isElementInViewport() function in helpers.dom.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  bc2b771b_9094_0de8_f360_db4beed8b338["isElementInViewport()"]
  6d259035_40ba_010b_6a02_2f0b7d38f073["ReferenceNavigationScrollHandler()"]
  6d259035_40ba_010b_6a02_2f0b7d38f073 -->|calls| bc2b771b_9094_0de8_f360_db4beed8b338
  style bc2b771b_9094_0de8_f360_db4beed8b338 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/ui/helpers.dom.ts lines 1–9

export function isElementInViewport(element: HTMLElement) {
  const { top, left, width, height } = element.getBoundingClientRect()
  const { innerWidth, innerHeight } = window

  return (
    ((top >= 0 && top < innerHeight) || (top < 0 && top + height > 0)) &&
    ((left >= 0 && left < innerWidth) || (left < 0 && left + width > 0))
  )
}

Subdomains

Frequently Asked Questions

What does isElementInViewport() do?
isElementInViewport() is a function in the supabase codebase.
What calls isElementInViewport()?
isElementInViewport() is called by 1 function(s): ReferenceNavigationScrollHandler.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free