هل تعلم؟dyk.si

فهرس الصفحة المتتبّع Scrollspy (On This Page)

قائمة «في هذه الصفحة» على الجانب، يتغيّر العنوان المميّز فيها حسب القسم الذي تقرؤه.

يُعرف أيضاً باسم: On This Page

IntersectionObserver + aria-current

متى تستخدمه

في صفحات التوثيق والمقالات الطويلة.

خطأ شائع

لا لزوم له في صفحة لا تحوي سوى قسمين.

إمكانية الوصول

Keep the links real anchors so they work without JavaScript.

اسمه في الكود

HTML/CSSIntersectionObserver + aria-current
ReactuseActiveHeading (custom)
Jetpack ComposeLazyListState.firstVisibleItemIndex
SwiftUIScrollPosition (custom)

برومبت جاهز لوكيل البرمجة

Add a Scrollspy (On This Page) to this screen. What it is: An On-this-page list whose highlighted link follows the section you’re reading. Implement with: IntersectionObserver + aria-current (HTML/CSS). Accessibility: Keep the links real anchors so they work without JavaScript. When to use it: On documentation and long articles. Avoid: Pointless on a page with two sections. Reuse the project's existing design tokens, spacing and component conventions.

أو ركّب صفحة كاملة من هذا العنصر وغيره →

البرومبت بالإنجليزية لأنها الأدق مع Claude Code وأمثاله.