Home / Function/ navigateToSection() — supabase Function Reference

navigateToSection() — supabase Function Reference

Architecture documentation for the navigateToSection() function in Content.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  7aabb8aa_409e_60c6_f749_645b94524b5f["navigateToSection()"]
  e34434dd_5a66_f4ca_c169_e47b853a1339["Subsections()"]
  e34434dd_5a66_f4ca_c169_e47b853a1339 -->|calls| 7aabb8aa_409e_60c6_f749_645b94524b5f
  5d2a75c5_444a_688f_c2c0_055f80498c74["MenuItems()"]
  5d2a75c5_444a_688f_c2c0_055f80498c74 -->|calls| 7aabb8aa_409e_60c6_f749_645b94524b5f
  style 7aabb8aa_409e_60c6_f749_645b94524b5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/ProjectAPIDocs/Content/Content.utils.ts lines 1–13

export const navigateToSection = (key: string) => {
  if (typeof window !== 'undefined') {
    const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches

    const el = document.getElementById(key)
    if (el) {
      el.scrollIntoView({ behavior: prefersReducedMotion ? 'instant' : 'smooth' })
      // Timeout needed to make sure  the focus behavior doesn't interrupt the
      // scrolling. Timing selected by trial and error.
      setTimeout(() => el.focus(), 300)
    }
  }
}

Subdomains

Frequently Asked Questions

What does navigateToSection() do?
navigateToSection() is a function in the supabase codebase.
What calls navigateToSection()?
navigateToSection() is called by 2 function(s): MenuItems, Subsections.

Analyze Your Own Codebase

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

Try Supermodel Free