Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Scrolling menu visibility hooks

Tracks which react-horizontal-scrolling-menu items are on screen so arrows and lazy loading behave.

Claude's review

7/10 scroll menu visibility hooks and observer pitfalls with right and wrong examples, one library only

We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.

In detail

Track which react-horizontal-scrolling-menu items are on screen: useIsVisible(itemId | 'first' | 'last', defaultValue), useLeftArrowVisible/useRightArrowVisible, the options prop (ratio, rootMargin, threshold), items.getVisible()/subscribe/unsubscribe, and the async IntersectionObserver truth model (items must be seen once, menuVisible gating, non-reactive isFirstItemVisible reads). Load when disabling arrows at the edges, styling items by visibility, building progress indicators, or debugging flickering or dead arrows.

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: 'menu-visibility'
description: >
  Track which react-horizontal-scrolling-menu items are on screen:
  useIsVisible(itemId | 'first' | 'last', defaultValue),
  useLeftArrowVisible/useRightArrowVisible, the options prop (ratio,
  rootMargin, threshold), items.getVisible()/subscribe/unsubscribe, and the
  async IntersectionObserver truth model (items must be seen once, menuVisible
  gating, non-reactive isFirstItemVisible reads). Load when disabling arrows at
  the edges, styling items by visibility, building progress indicators, or
  debugging flickering or dead arrows.
metadata:
  type: core
  library: 'react-horizontal-scrolling-menu'
  library_version: '8.3.2'
sources:
  - 'asmyshlyaev177/react-horizontal-scrolling-menu:README.md'
  - 'asmyshlyaev177/react-horizontal-scrolling-menu:src/createApi.ts'
  - 'asmyshlyaev177/react-horizontal-scrolling-menu:src/hooks/useIntersectionObserver.ts'
  - 'asmyshlyaev177/react-horizontal-scrolling-menu:src/settings.ts'
  - 'asmyshlyaev177/react-horizontal-scrolling-menu:src/ItemsMap/ItemsMap.ts'
---

# Visibility Tracking

Visibility is IntersectionObserver-driven and **asynchronous**. An item has
visibility data only after the observer has reported it at least once — which
requires the menu itself to have been on screen. Nothing is true
synchronously: not at mount, not on the server, not in the same tick as a
click or a scroll call. Read visibility reactively (hooks) or inside
callbacks (`onUpdate`, event handlers) — never as a one-shot read during
setup.

Two structural facts drive everything below:

- All state lives in `api.items`, an `ItemsMap` (a `Map` of
  `String(itemId) → IOItem`), where `IOItem` is
  `{ index: string; key: string; entry: IntersectionObserverEntry; visible: boolean }`.
- The hooks live **on the context api object** (`api.useIsVisible(...)`,
  `api.useLeftArrowVisible()`). Unusual, but rules-of-hooks-safe: the api is
...

From asmyshlyaev177's repository, MIT licence.

Related skills

  • Checked

    TinyBase app builder

    Scaffolds and extends local first JavaScript apps with TinyBase, including schemas, persistence and sync.

    by tinyplex 5.2k
    7/101 credit
  • Checked

    ComfyUI custom node UI

    Adds widgets, sidebar tabs, commands and dialogs to ComfyUI custom nodes, so your node feels built in.

    by jtydhr88 325
    8/101 credit
  • Checked

    Scrolling menu upgrade

    Finds outdated react-horizontal-scrolling-menu code and rewrites it for version 8 so the menu works again.

    by asmyshlyaev177 789
    7/101 credit
  • Checked

    Scroll Menu Testing and SSR

    Gets react-horizontal-scrolling-menu working in Next.js and tested in Jest and Playwright without flicker.

    by asmyshlyaev177 789
    7/101 credit
  • Checked

    Screenshot to React code

    Rebuilds a screenshot or mockup as React, TypeScript and Tailwind code that closely matches the design.

    by buildfastwithai 792
    7/101 credit
  • Checked

    Map location picker

    Adds a map pin picker to a web form, so users can choose and submit one exact spot like a delivery address.

    by cyphercodes 84
    7/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added