منطقة التمرير
صندوق يمرّر محتواك بالتمرير الخاص بالمنصة، ويبيّن على كل حافة يراقبها أن وراءها مزيدًا من المحتوى — بشريط بلون السطح، أو بتلاشي المحتوى، أو بخط، أو بتمويه — من غير أن يغيّر حجمه أو يحرّك المحتوى.
- الفئة
- الاحتواء
- الرموز
comp.scroll-area- المستوى
- أساسي
- Web
tanrei-scroll-areaclock_loader_40 - SwiftUI
TanreiScrollArearadio_button_unchecked - Jetpack Compose
TanreiScrollArearadio_button_unchecked - Flutter
TanreiScrollArearadio_button_unchecked - React Native
ScrollArearadio_button_unchecked
مولَّد من docs/status/status.json, specs/scroll-area.spec.json
قائمة في صندوق ثابت الارتفاع
ما دام المحتوى يتسع، لا ترسم المنطقة شيئًا من عندها. مرّرها: تُعلَّم الحافة السفلية ما دام في الأسفل مزيد، والعلوية حالما يُمرَّر شيء خارج المنظر من الأعلى.
عيّنتا Web و React تعرضان المواصفة الحالية. أما SwiftUI و Compose و Flutter و React Native فمخطَّط لها: لا تقدّم منطقة تمرير بعد.
<!-- التخطيط يعطي المنطقة حجمها؛ وهي تعلّم حافتيها العلوية والسفلية افتراضيًّا. -->
<tanrei-scroll-area label="الرسائل" style="block-size: 20rem">
…
</tanrei-scroll-area>
<!-- على بطاقة filled: يأخذ الظل لون البطاقة، فتبدو القائمة كأنها تغوص فيها. -->
<tanrei-scroll-area label="النتائج" style="--tanrei-comp-scroll-area-shadow-color: var(--tanrei-comp-card-filled-container-color); block-size: 16rem">
…
</tanrei-scroll-area>
<!-- فوق صورة أو فيديو: يتلاشى المحتوى نفسه، ولا يُرسم أي لون. -->
<tanrei-scroll-area scroll-edge="fade" label="الترجمة النصية">…</tanrei-scroll-area>
<!-- صف يُمرَّر أفقيًّا: علّم حافتي البداية والنهاية. -->
<tanrei-scroll-area edges="start end" label="الصور">…</tanrei-scroll-area>
<script type="module">
import '@tanrei/web/components/scroll-area';
</script>import { ScrollArea } from '@tanrei/react';
<ScrollArea label="الرسائل" style={{ blockSize: '20rem' }}>
{messages}
</ScrollArea>
{/* على بطاقة filled: يأخذ الظل لون البطاقة. */}
<ScrollArea
label="النتائج"
style={{ '--tanrei-comp-scroll-area-shadow-color': 'var(--tanrei-comp-card-filled-container-color)', blockSize: '16rem' } as React.CSSProperties}
>
{results}
</ScrollArea>
<ScrollArea scrollEdge="fade" label="الترجمة النصية">{captions}</ScrollArea>
<ScrollArea edges={['start', 'end']} label="الصور">{photos}</ScrollArea>حواف التمرير: shadow (اختيار النظام الافتراضي) و fade و line و blur و none
الظل. شريط بلون السطح الذي تقف عليه المنطقة، كامل عند الحافة ويختفي على بعد 24 منها. مرّرها لترى الحافة العلوية معلَّمة أيضًا. يبدو المحتوى كأنه يغوص في السطح.
التلاشي. يتلاشى المحتوى نفسه نحو الحافة ولا يُرسم أي لون، فيظهر ما وراء المنطقة من خلاله. مرّرها لترى الحافة العلوية معلَّمة أيضًا.
الخط. خط رفيع على طول الحافة بلون الفاصل، ما دام وراءها محتوى. مرّرها لترى خطًّا يظهر في الأعلى ويختفي الخط السفلي.
التمويه. يُموَّه المحتوى في شريط عمقه 48، أشدّ ما يكون عند الحافة ولا شيء عند طرف الشريط الداخلي. مرّرها لترى الحافة العلوية معلَّمة أيضًا.
بلا علامة. لا شيء يعلّم الحواف: شريط التمرير الخاص بالمنصة وحده يقول إن المحتوى مستمر. مرّرها لتقارنها بالأخريات.
البنية
| الجزء | الوصف |
|---|---|
1 container | The scroll box: as large as its layout gives it, scrolling the content up and down, sideways or both where it does not fit, with the platform's own scrolling and scroll bars. It has no fill, edge or corner of its own. |
2 content | Whatever the product puts in it: a list, a column of cards, a form, a row of pictures. The area lays nothing out and styles nothing inside it. |
3 scroll-edge · اختياري | The mark at one edge of the box while content lies beyond that edge: a band in the color of the surface the box stands on, full at the edge and none at its inner end; a fade of the content itself toward the edge; a line along it; or a band in which the content is blurred, most at the edge. Drawn over the content (the fade, on it), taking no input. |
4 focus-ring · اختياري | The system's focus indicator inside the box's edge, while the box itself has keyboard focus. |
الخصائص
| الخاصية | النوع | القيمة الافتراضية | الوصف |
|---|---|---|---|
scrollEdge | auto | shadow | fade | line | blur | none | "auto" | How an edge shows that content lies beyond it. shadow: a band in the color of the surface the area stands on, so that the content sinks into the surface. fade: the content itself fades out toward the edge and no color is drawn, for a transparent surface, a picture or a video behind the area. line: a hairline along the edge. blur: the content blurred in a band along the edge, most at the edge. none: nothing. auto takes comp.scroll-area.scroll-edge, the design system's answer, which follows sys.behavior.scroll-edge (shadow in the default system). |
edges | strings | top,bottom | Which edges show the scroll edge: any of top, bottom, start and end. start is the left in a left-to-right layout and the right in a right-to-left one. |
label | string | "" | The name of the scroll box, for the moments it is a focus stop of its own (SCA-10): what it holds ("Messages", "Results"). Never drawn. |
المنافذ
| المنفذ | الوصف |
|---|---|
default | The content the area scrolls. A fixture's string is drawn as plain text in it. |
الحالات
السلوك
متطلبات بصيغة EARS. يُختبر تنفيذ كل منصة مقابل هذه المعرّفات. يُعرض نص المتطلبات كما ورد في ملف المواصفة، بالإنجليزية.
| المعرّف | المتطلب |
|---|---|
SCA-1 | THE scroll area SHALL be as large as its layout gives it, SHALL lay its content out at its own width, and WHERE the content does not fit SHALL scroll it with the platform's own scrolling — wheel, trackpad, touch, scroll bars, keyboard and assistive technology — in each direction it does not fit; it SHALL draw no fill, edge, corner or elevation of its own, and SHALL NOT replace the platform's scroll bars. |
SCA-2 | WHILE content lies beyond an edge that edges names — the content is scrolled away from that edge, so that some of it is out of view past it — THE scroll area SHALL draw the scroll edge of that edge in the form its scroll edge (SCA-7) names; WHILE nothing lies beyond it, or the edge is not named, THE scroll area SHALL draw none there. Each edge SHALL be drawn and faded by itself: content beyond the top and none beyond the bottom draws the top edge only. |
SCA-3 | WHILE the scroll edge is shadow THE scroll area SHALL draw over the content, along the whole length of the edge and inside the box, a band comp.scroll-area.shadow.extent deep in comp.scroll-area.shadow.color — the color of the surface the area stands on, not a color of its own — full at the edge and falling smoothly to none at the band's inner end, and SHALL draw no line. |
SCA-4 | WHILE the scroll edge is fade THE scroll area SHALL fade the content itself along the edge, none of it shown at the edge rising smoothly to all of it at comp.scroll-area.fade.extent in from it, SHALL draw no color and no line, so that whatever lies behind the area — a transparent surface, a picture, a video — shows through where the content fades. |
SCA-5 | WHILE the scroll edge is line THE scroll area SHALL draw it as a line comp.scroll-area.line.width thick in comp.scroll-area.line.color along the whole length of the edge, inside the box. |
SCA-6 | WHILE the scroll edge is blur THE scroll area SHALL blur the content lying in a band comp.scroll-area.blur.extent deep along the edge, by comp.scroll-area.blur.radius at the edge falling to none at the band's inner end, in comp.scroll-area.blur.layers layers of evenly stepped radius, each masked to its part of the band so that no step is seen, and SHALL draw no line and no tint: the scroll area has no fill of its own to tint with. |
SCA-7 | THE scroll area SHALL take its scroll edge from scrollEdge: WHILE scrollEdge is auto, as comp.scroll-area.scroll-edge names, which follows sys.behavior.scroll-edge unless a design system sets the scroll area apart; WHILE it is shadow, fade, line, blur or none, as that value names, whatever the tokens say. WHEN scrollEdge, or the token it follows, changes THE scroll area SHALL draw the other form at once, keeping the scroll position and focus. |
SCA-8 | WHEN content starts or stops lying beyond an edge THE scroll area SHALL fade that edge's scroll edge in or out over comp.scroll-area.motion.duration with comp.scroll-area.motion.easing, and at once where motion is reduced; it SHALL NOT change its size, move the content, or change anything else it draws because of the scroll edge. It SHALL learn whether content lies beyond an edge from what the platform already knows of the scroll — its notice that a mark at that end of the content has entered or left the box, or the scroll's own extents — and SHALL NOT measure the content's layout in a frame of a scroll. |
SCA-9 | WHERE the platform cannot blur what lies behind a band (a browser without backdrop filters, Android before version 12, a platform where the product gave no blur view) THE scroll area SHALL draw shadow (SCA-3), the system's first form, in place of a blur; WHERE the platform draws with a person's own forced colors THE scroll area SHALL draw the line of SCA-5 in the platform's text color in place of a shadow, a fade or a blur. |
SCA-10 | WHILE the content does not fit and nothing inside the box takes keyboard focus THE scroll area SHALL make the box itself one stop in the focus order, exposed as a region named by label, so that a keyboard can scroll it (WCAG 2.1.1); WHILE something inside takes focus, or the content fits, THE scroll area SHALL NOT be a focus stop and SHALL expose no role of its own. WHILE it is a focus stop and label is empty it SHALL still be focusable, and in debug builds report that the region has no accessible name. |
SCA-11 | WHILE the box has keyboard focus THE scroll area SHALL show it as sys.behavior.focus-style names (ring or glow), drawn wholly inside its edge so that nothing around the box covers it, over every scroll edge and never faded by one, without animation, and never for focus gained by pointer or touch; a platform that cannot draw a choice SHALL fall back to the first value and state that in its README. |
SCA-12 | THE scroll area SHALL draw every scroll edge over the content (the fade, on the content itself), hidden from assistive technology, and SHALL let every press, hover and scroll over it reach the content under it. |
SCA-13 | WHERE the layout direction is right-to-left THE scroll area SHALL take start as its right edge and end as its left edge, SHALL begin a sideways scroll at the right, and SHALL mirror no scroll edge otherwise: each form is drawn the same toward whichever edge it stands at. |
SCA-14 | THE scroll area SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the area is shown THE scroll area SHALL draw itself for the new direction at once, keeping its scroll position from the start edge. |
SCA-15 | IF scrollEdge names a value the component does not define THE scroll area SHALL treat it as auto, IF edges names a value other than top, bottom, start and end THE scroll area SHALL ignore it, and in debug builds report the unknown value. |
SCA-16 | WHILE the text size is enlarged THE scroll area SHALL keep its scroll edges at their sizes and lay out the larger content, which scrolls further: a scroll edge is a mark of the box, not of its text. |
SCA-17 | THE scroll area SHALL have no words of its own and SHALL read none of the product's words: label names this one region. |
SCA-18 | WHERE the platform has ARIA attributes (the web), WHEN the product sets an aria- attribute on the host, by the attribute or by the ARIA property that reflects it, THE scroll area SHALL move it to the data-aria- attribute of the same name, so that the host is no second node with its name, description or state, and SHALL expose it on its box — an id reference by the elements it names in the host's tree or a tree around it, a description after its own — but a name only while the box is a focus stop and a region (SCA-10): then label is its name over a name given so, and while label is empty a name given so is its name and SHALL NOT be reported as having none in debug builds. WHILE the box is not a focus stop it has no role a name could stand on: THE scroll area SHALL expose no name the product gives on the host, and SHALL report it in debug builds. WHEN the product removes the aria- attribute or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaDescribedByElements…) to null, THE scroll area SHALL take it off the box. |
مطابقة الأسماء بين المنصات
التكافؤ لا يعني واجهات برمجية متطابقة. تعبّر كل منصة عن العقد نفسه بأسلوبها.
| المواصفة | Web | SwiftUI | Jetpack Compose | Flutter | React Native |
|---|---|---|---|---|---|
| المكوّن | tanrei-scroll-area | TanreiScrollArea | TanreiScrollArea | TanreiScrollArea | ScrollArea |
scrollEdge · الخاصية | scrollEdge | scrollEdge | scrollEdge | scrollEdge | scrollEdge |
edges · الخاصية | edges | edges | edges | edges | edges |
label · الخاصية | label | label | label | label | label |
| ملاحظات | <tanrei-scroll-area scroll-edge edges="top bottom" label>; edges is a space-separated attribute and an array property. Whether content lies beyond an edge is read from one IntersectionObserver on four thin sentinels at the ends of the content (SCA-8): no scroll listener, no layout read while scrolling. Not CSS scroll-driven animations: they are not in every engine, and they tie the mark to the distance scrolled rather than fading it over the state motion. shadow is a gradient band per edge in --tanrei-comp-scroll-area-shadow-color; set that custom property on the element, or on an ancestor, to the surface it stands on. fade is a mask-image on the scroll box, one gradient per axis, moved by mask-position and mask-size (no registered custom property), so the browser's scroll bar fades with the content at a faded edge. blur is blur.layers layers inside each band, each with backdrop-filter: blur(r × i / n) and a mask-image gradient; @supports not (backdrop-filter: blur(1px)) draws shadow (SCA-9). Every mark is pointer-events: none and aria-hidden. A fixture fills the slot with enough lines (or a row wide enough) to scroll, in a box of a fixed size, scrolled to the middle. | A ScrollView. onScrollGeometryChange tells whether content lies beyond an edge. shadow is a LinearGradient overlay from the surface color; fade a mask of a gradient; on iOS 26 and macOS 26 blur is the system's scrollEdgeEffectStyle(.soft, for:) and line .hard with the line drawn by Tanrei, before them blur is a Material band under a gradient mask. | A verticalScroll/horizontalScroll box (or the product's lazy list through a ScrollState/LazyListState parameter); canScrollBackward/canScrollForward tell the edges. shadow is a drawWithContent gradient in the surface color; fade a BlendMode.DstIn gradient on an offscreen layer; blur draws the band's content again under graphicsLayer { renderEffect = BlurEffect(…) } with a gradient mask on API 31 and later, and shadow below it. | A SingleChildScrollView (or the product's scrollable via its ScrollController); ScrollMetrics.extentBefore/extentAfter, read in a NotificationListener<ScrollMetricsNotification>, tell the edges. shadow is a DecoratedBox gradient in the surface color; fade a ShaderMask with BlendMode.dstIn; blur BackdropFilter bands under ShaderMask. | A ScrollView; onScroll with scrollEventThrottle and the content size tell the edges, and the edge state is set only when it changes. shadow is a gradient view in the surface color where the product passes a gradient component, else a stack of translucent strips; fade needs a masked view the product passes, and is drawn as shadow without it. React Native has no blur of its own: blur is drawn only where the product passes a blur view component; otherwise shadow (SCA-9). |
الرموز
| الرمز | يشير إلى | القيمة المحلولة (فاتح) |
|---|---|---|
--tanrei-comp-scroll-area-blur-extent | sys.scroll-edge.blur.extent | 48px |
--tanrei-comp-scroll-area-blur-layers | sys.scroll-edge.blur.layers | 4 |
--tanrei-comp-scroll-area-blur-radius | sys.scroll-edge.blur.radius | 8px |
--tanrei-comp-scroll-area-fade-extent | sys.scroll-edge.extent | 24px |
--tanrei-comp-scroll-area-line-color | sys.color.outline-variant | |
--tanrei-comp-scroll-area-line-width | sys.border.hairline | 1px |
--tanrei-comp-scroll-area-motion-duration | sys.motion.role.state.default | 250ms |
--tanrei-comp-scroll-area-motion-easing | sys.motion.easing.state | cubic-bezier(0.2, 0, 0, 1) |
--tanrei-comp-scroll-area-scroll-edge | sys.behavior.scroll-edge | 0 |
--tanrei-comp-scroll-area-shadow-color | sys.color.surface | |
--tanrei-comp-scroll-area-shadow-extent | sys.scroll-edge.extent | 24px |
نماذج الاختبار
عروض مرجعية. تلتقط كل المنصات لقطة لكل نموذج بالمعرّف نفسه حتى يمكن مقارنة النتائج.
default
label: Messages slots: default fade
scrollEdge: fade label: Messages slots: default line
scrollEdge: line label: Messages slots: default blur
scrollEdge: blur label: Messages slots: default none
scrollEdge: none label: Messages slots: default sideways
edges: ["start","end"] label: Photos slots: default rtl-sideways
edges: ["start","end"] label: Photos direction: rtl slots: default مولَّد من specs/scroll-area.spec.json, tokens/comp/scroll-area.tokens.json, design/tokens/
استخدم منطقة التمرير حيث يعطي تخطيطك جزءًا من الشاشة حجمًا ثابتًا وقد يكون محتواه أطول منه: قائمة رسائل بجانب محادثة، النتائج تحت حقل البحث، نموذج طويل في جزء من الشاشة، صف من الصور يُمرَّر أفقيًّا. تُبقي المنطقة المحتوى حيث وضعته، وتقول على كل حافة تراقبها إن وراءها مزيدًا.
لا تحتاج إليها حول مكوّن يُمرَّر بنفسه — الجدول، ومحتوى مربع الحوار، واللوحة — ولا حول الصفحة: فتمرير الصفحة نفسها ليست له حافة تُعلَّم. ويرسم كلٌّ من مربع الحوار واللوحة واللوحة المنبثقة وشريط التطبيق خطه بنفسه حيث يلتقي جزء ثابت في مكانه بمحتوى يُمرَّر.
| الهيئة | تُستخدم لـ |
|---|---|
shadow |
سطح معتم: يغوص المحتوى فيه. يُرسم الشريط بلون السطح الذي تقف عليه المنطقة، لا برمادي خاص به. وهو اختيار النظام الافتراضي. |
fade |
سطح شفاف، أو صورة، أو فيديو خلف المنطقة. يتلاشى المحتوى نفسه ولا يُرسم أي لون، فيظهر ما وراءه. |
line |
منتج يعلّم حوافه بالخطوط، وتخطيط كثيف يغطي فيه الشريط قدرًا كبيرًا من المحتوى. الخط خط رفيع بلون الفاصل. |
blur |
منتج أشرطته وحوافه شبه شفافة: يلين المحتوى عند الحافة. وهو أعلى الهيئات كلفة في الرسم (أدناه). |
none |
صندوق يمكن أن تبقى حوافه كما هي، كصندوق شريط تمريره ظاهر دائمًا ويكفي. |
تُرسم كل حافة وحدها، وما دام وراءها محتوى فقط: في أول القائمة لا تُعلَّم إلا الحافة السفلية. وحين يتغير ذلك تظهر علامة الحافة وتختفي تدريجيًّا، وفورًا حيث تُقلَّل الحركة. ولا تغيّر العلامة حجم المنطقة أبدًا، ولا تحرّك المحتوى أبدًا.
تسمّي edges الحواف المراقَبة: top و bottom افتراضيًّا، و start و end لصف يُمرَّر أفقيًّا. البداية هي اليسار في تخطيط من اليسار إلى اليمين، واليمين في تخطيط من اليمين إلى اليسار (RTL).
الظل شريط بلون السطح نفسه موضوع فوق المحتوى، كامل عند الحافة. على السطح الذي يسمّيه لونه يلتحم بالسطح بلا أثر؛ وعلى أي سطح آخر يبدو لطخة بلون خاطئ. القيمة الافتراضية لـ comp.scroll-area.shadow.color هي السطح العادي (sys.color.surface). وحيث تقف المنطقة على سطح آخر — بطاقة، أو لوحة، أو لون حاوية — اجعله لون ذلك السطح: في طبقة، لكل منطقة تمرير تقف هناك، أو على تلك النسخة وحدها. على الويب هذه هي الخاصية المخصَّصة --tanrei-comp-scroll-area-shadow-color، تُضبط على العنصر أو على أحد أسلافه.
وحيث لا يقف خلف المنطقة شيء معتم — لوحة شبه شفافة، أو صورة، أو فيديو — لا يكون أي لون صحيحًا. اختر fade هناك.
يعيد التمويه رسم المحتوى الذي في شريطه، مموَّهًا، في كل إطار من التمرير: comp.scroll-area.blur.layers طبقات بنصف قطر متدرج (4 في النظام الافتراضي، حتى نصف قطر 8 عند الحافة، في شريط عمقه 48). استخدمه حيث يطلبه مظهر المنتج، واقتصر على حافتين مموَّهتين على الأكثر في الشاشة الواحدة — أعلى قائمة واحدة وأسفلها، لا كل جزء من الشاشة. وحيث لا تستطيع المنصة تمويه ما خلف الشريط (متصفح بلا مرشحات خلفية، أو Android قبل الإصدار 12، أو React Native بلا عرض تمويه يمرّره منتجك)، ترسم المنطقة shadow بدلًا منه؛ لذا اضبط لون الظل حتى حيث تختار التمويه.
ما يعلّم حافة صندوق يُمرَّر اختيار نوع يُتخذ مرة واحدة للمنتج: لا ينبغي أن تعلّم قوائمه ونماذجه وأجزاء شاشته حوافها كلٌّ بطريقة.
tanrei.sys.behavior.scroll-edge
What marks an edge of a box that scrolls while content lies beyond it, scrolled out of view past that edge. shadow: a band sys.scroll-edge.extent deep in the color of the surface the box stands on, full at the edge and none at the band's inner end, so that the content sinks into the surface. fade: the content itself fades out over the same depth toward the edge, so that whatever lies behind it — a transparent surface, a picture, a video — shows through. line: a hairline along the edge. blur: the content blurred in a band sys.scroll-edge.blur.extent deep, most at the edge. A platform that cannot blur what lies behind draws shadow, the first value; with a person's own forced colors every choice is drawn as the line. Read by the scroll area through its own component token, so that a design system can set it apart; an instance can set its own.
مولَّد من tokens/sys/behavior.tokens.json
تقرأ منطقة التمرير هذا الاختيار عبر رمزها الخاص comp.scroll-area.scroll-edge، فيستطيع نظام التصميم أن يميّز منطقة التمرير عن اختيار النظام. وتضبط النسخة الواحدة اختيارها بـ scrollEdge (scroll-edge على الويب)؛ وقيمتها الافتراضية auto تتبع الرموز. يرسم النظام الافتراضي shadow؛ ويرسم m3-like الهيئة line و cupertino الهيئة blur، كما تعلّم أصولهما الحواف التي تُمرَّر.
| نظام التصميم | scroll-edge |
|---|---|
tanrei | shadow |
cupertino | blur |
m3-expressive-like | line |
m3-like | line |
مولَّد من tokens/systems/*.system.json, design/tokens/<system>/tanrei.light.tokens.json
اختياران من اختيارات النظام يتعلقان بالتمرير، ويجيبان عن سؤالين مختلفين:
sys.behavior.divider-visibilityيقول متى يظهر خط المنطقة الثابتة: حافة شريط التطبيق، وحافة رأس مربع الحوار وإجراءاته، وحافة رأس اللوحة — جزء يبقى في مكانه بينما يُمرَّر المحتوى تحته. يُرسم دائمًا، أو فقط ما دام شيء قد مُرِّر وراءه.sys.behavior.scroll-edgeيقول ما الذي يعلّم حافة صندوق يُمرَّر، ما دام وراء تلك الحافة محتوى: ظل، أو تلاشٍ، أو خط، أو تمويه.
يستطيع المنتج أن يضبطهما كلًّا على حدة: مربع حوار يتبع خط رأسه التمرير، وبجانبه قوائم تغوص في سطحها.
منطقة التمرير هي صندوق التمرير الخاص بالمنصة، مرسومة فوق حوافه علامات. تعمل عجلة الفأرة ولوحة اللمس واللمس ولوحة المفاتيح والتقنيات المساعدة وأشرطة التمرير الخاصة بالمنصة كما تعمل في أي صندوق آخر، وتحتفظ أشرطة التمرير بمظهر المنصة. لا تضيف المنطقة تمريرًا خاصًّا بها، ولا التقاطًا (snap)، ولا شريط تمرير؛ ولا ترتّب شيئًا بداخلها، وليست لها تعبئة ولا حدّ ولا زوايا. نسّق المحتوى كما تنسّقه في أي مكان آخر.
- أعطِ المنطقة حجمها في تخطيطك: ارتفاعًا، أو حصة من شبكة، أو المكان الذي يتركه رأس وتذييل. فهي تأخذ الحجم الذي تُعطاه.
- اجعل لون الظل لون السطح الذي تقف عليه المنطقة، كلما لم يكن السطح العادي.
- أعطِها تسمية تقول ما الذي تحويه: «الرسائل»، «النتائج»، «الصور».
- لا ترسم فاصلًا أو حدًّا أو تدرجًا لونيًّا من عندك على حافة تُمرَّر. اختر حافة التمرير، فلا تظهر إلا ما دام وراء الحافة محتوى، وتطابق بقية المنتج.
- لا تستخدم الظل فوق صورة أو فيديو أو سطح شبه شفاف. استخدم التلاشي.
- لا تضع أكثر من حافتين مموَّهتين في شاشة واحدة.
- لا تضع مناطق تمرير تُمرَّر في الاتجاه نفسه بعضها داخل بعض. لا يستطيع الشخص أن يعرف أيّها سيحرّكه السحب.
- لا تُخفِ أشرطة التمرير الخاصة بالمنصة لتفسح مكانًا للعلامات. العلامات تقول إن هناك المزيد؛ وشريط التمرير يقول كم، وهو عنصر تحكم قائم بذاته.
- الدور
region, only while the box is a focus stop of its own (SCA-10); otherwise none- التسمية
- While the box is a focus stop it is a region named by label. The scroll edges are hidden.
- الحد الأدنى للهدف
- تستوفي مساحة اللمس الحد الأدنى لحجم الهدف حتى لو كان الحجم المرئي أصغر. minimum 32px · pointer 44px · spacing 8px · touch 48px
لوحة المفاتيح
| المفاتيح | الإجراء |
|---|---|
| Tab | Moves focus into the content, or to the box itself while nothing inside takes focus and the content does not fit. |
| Arrow keys, Page Up, Page Down, Home, End, Space | Scroll the box while it has focus, as the platform scrolls any scroll box. |
ملاحظات
- Not interactive except as a scroll box: it has no target of its own, and its focus stop exists only so that a keyboard can scroll content that has nothing focusable (WCAG 2.1.1).
- Animation from interactions (WCAG 2.3.3): the scroll edge's fade is a change of opacity, not motion, and is still made at once where motion is reduced.
- A shadow or a fade lowers the contrast of the content it lies over, by design, only within its band and only while that content is scrolled toward the edge; the content is read at full contrast once it is scrolled into view.
مولَّد من specs/scroll-area.spec.json, tokens/sys/measure.tokens.json
- ما دام محتواه لا يتسع ولا شيء بداخله يقبل تركيز لوحة المفاتيح، يصير الصندوق نفسه موضع توقف واحدًا في ترتيب التركيز، ويُعرض منطقةً (region) اسمها
label، لكي تستطيع لوحة المفاتيح تمريره (WCAG 2.1.1). تمرّره مفاتيح الأسهم والمفاتيح Page Up و Page Down و Home و End و Space، كما تمرّر المنصة أي صندوق. - ما دام شيء بداخله يقبل التركيز، أو المحتوى يتسع، لا يكون الصندوق موضع توقف ولا يعرض دورًا: تصل لوحة المفاتيح إلى المحتوى، ويُمرَّر المحتوى إلى المنظر حين يتلقى التركيز.
- يُرسم مؤشر التركيز داخل حافة الصندوق، فوق كل علامة ولا تخفّفه علامة أبدًا، ولتركيز لوحة المفاتيح وحده.
- العلامات مخفية عن التقنيات المساعدة، وكل ضغط ومرور بالمؤشر وتمرير فوقها يصل إلى المحتوى تحتها.
- تظهر علامة الحافة وتختفي تدريجيًّا في وقت قصير، وهذا تغيّر في العتامة لا حركة؛ وحين يُطلب تقليل الحركة تظهر فورًا.
- في الألوان المفروضة (forced colors) تُرسم كل هيئة خطًّا بلون النص.
- ليست له كلمات خاصة به. التسمية الفارغة ما دام الصندوق موضع توقف، وقيم
scrollEdgeأوedgesغير المعروفة يُبلَّغ عنها في بنيات التنقيح (debug).
- أعطِها
labelيقول ما الذي تحويه. من يصل إلى الصندوق بالمفتاح Tab يسمع هذا الاسم؛ ومن غيره لا يسمع إلا أن هنا منطقة. - توقّع أن المحتوى الذي تحت الشريط يُقرأ حين يُمرَّر إلى المنظر، لا في مكانه. فالظل أو التلاشي يخفض تباين المحتوى الذي تحته، عن قصد، لكن داخل شريطه فقط، وما دام ذلك المحتوى ممرَّرًا نحو الحافة فقط؛ ويعود المحتوى إلى تباينه الكامل حالما يُمرَّر إلى المنظر.
- أعلِن المحتوى الذي يتغير وحده (قائمة حيّة، رسائل جديدة) كما تعلنه في أي مكان آخر. المنطقة لا تُعلِن ما يدخل بالتمرير.