सीधे मुख्य कॉन्टेंट पर जाएँ
menumenu tanreiexpand_morecontrasttranslate
tanreiexpand_more
शुरुआत करेंWebReactSwiftUIJetpack ComposeFlutterReact Nativeप्रीसेटआपका अपना डिज़ाइन सिस्टमAI एजेंट के साथ Tanrei का इस्तेमालब्रांडडिज़ाइन टोकनडिज़ाइन सिस्टम और कस्टमाइज़ेशनTheme Studioरंगटाइपोग्राफ़ीआइकनशेपएलिवेशनमोशनइंटरैक्शन स्टेटव्यवहारलेआउटसुलभताशब्दकलर टोकनटाइप स्केल टोकनशेप टोकनएलिवेशन टोकनमोशन टोकनस्टेट टोकनस्पेस और माप के टोकनकंपोनेंटबटनमुख्य ऐक्शन बटनसेगमेंटेड बटनबटन ग्रुपमेन्यू वाला बटनटूलबारकॉपी बटनचेकबॉक्सरेडियो बटनस्विचचिपमेन्यूस्लाइडरस्लाइडर फ़ील्डकैलेंडरDateTimePickerफ़ील्ड ग्रुपरेडियो ग्रुपचेकबॉक्स ग्रुपसिलेक्टसिलेक्ट फ़ील्डमेन्यू बारफ़ाइल अपलोडफ़ाइल पिकर उन्नतड्रॉप ज़ोनटेक्स्ट इनपुट उन्नतटेक्स्ट फ़ील्डचिप फ़ील्डफ़ील्डकॉम्बोबॉक्स उन्नतकॉम्बोबॉक्स फ़ील्डनंबर इनपुट उन्नतनंबर फ़ील्डकलर इनपुट उन्नतकलर फ़ील्डवन-टाइम कोड इनपुट उन्नतवन-टाइम कोड फ़ील्डएम्बेडेड टेक्स्ट इनपुट उन्नतचैट कंपोज़रकार्डडिवाइडरमोडल लेयर उन्नतडायलॉगलिस्टलिस्ट पंक्तिबॉटम शीटसाइड शीटकैरसेलकोड ब्लॉकटेबलपॉपओवरचरणअकॉर्डियनडिस्क्रिप्शन लिस्टफ़िगरऐप शेलपेज हेडरट्री व्यूटाइमलाइनइमेज प्रीव्यूसाइज़ हैंडलसाइज़ बदलने वाला फ़्रेमस्क्रॉल एरियाबैजप्रोग्रेस इंडिकेटरमीटरनंबर टिकरलोडिंग इंडिकेटरस्नैकबारटूलटिपकीबोर्ड शॉर्टकटटैगइनलाइन कोडकॉलआउटअवतारख़ाली स्टेटटैग ग्रुपस्केलेटनफ़ाइल आइटमस्वॉचमार्की टेक्स्टटैबटैब व्यूऐप बारनेविगेशन बारनेविगेशन ड्रॉअरखोजलिंकपेजिनेशनपिछला और अगला लिंकस्टेपरब्रेडक्रंबविषय सूचीलिंक कार्डFAB मेन्यूस्थितिTanrei कैसे बनता हैयोगदानलाइसेंस और श्रेय
होमकंपोनेंटस्क्रॉल एरिया

स्क्रॉल एरिया

एक बॉक्स जो आपके कॉन्टेंट को प्लैटफ़ॉर्म के अपने स्क्रॉल से स्क्रॉल करता है और जिन किनारों पर वह नज़र रखता है, उनमें से हर एक पर दिखाता है कि आगे और कॉन्टेंट है — सरफ़ेस के रंग की एक पट्टी, कॉन्टेंट का फ़ेड, एक रेखा या ब्लर — बिना अपना साइज़ बदले या कॉन्टेंट को खिसकाए।

content_copyMarkdown में देखें
श्रेणी
कंटेनमेंट
टोकन
comp.scroll-area
स्तर
आधार

अवलोकन

Web
tanrei-scroll-area
clock_loader_40
SwiftUI
TanreiScrollArea
radio_button_unchecked
Jetpack Compose
TanreiScrollArea
radio_button_unchecked
Flutter
TanreiScrollArea
radio_button_unchecked
React Native
ScrollArea
radio_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 रूप में लिखी गई आवश्यकताएँ। हर प्लैटफ़ॉर्म के इम्प्लीमेंटेशन को इन ID के आधार पर टेस्ट किया जाता है। आवश्यकताओं का पाठ स्पेक फ़ाइल से ज्यों का त्यों, अंग्रेज़ी में दिखाया गया है।

ID आवश्यकता
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.

प्लैटफ़ॉर्म के अनुसार नामों का मिलान

पैरिटी का मतलब एक जैसे API नहीं है। हर प्लैटफ़ॉर्म एक ही कॉन्ट्रैक्ट को अपने तरीक़े से व्यक्त करता है।

स्पेक 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 #000000 · 8%
--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 #ffffff
--tanrei-comp-scroll-area-shadow-extent sys.scroll-edge.extent 24px

फ़िक्स्चर

मानक रेंडरिंग। हर प्लैटफ़ॉर्म हर फ़िक्स्चर का स्नैपशॉट एक ही ID से लेता है, ताकि नतीजों की तुलना की जा सके।

इससे जनरेट किया गया: specs/scroll-area.spec.json, tokens/comp/scroll-area.tokens.json, design/tokens/

दिशानिर्देश

कब इस्तेमाल करें

स्क्रॉल एरिया वहाँ इस्तेमाल करें जहाँ आपका लेआउट स्क्रीन के किसी हिस्से को तय साइज़ देता है और उसका कॉन्टेंट उससे लंबा हो सकता है: बातचीत के बग़ल में संदेशों की लिस्ट, सर्च फ़ील्ड के नीचे नतीजे, किसी पेन में लंबा फ़ॉर्म, बग़ल की ओर स्क्रॉल होने वाली तस्वीरों की पंक्ति। एरिया कॉन्टेंट को वहीं रखता है जहाँ आपने उसे रखा, और जिन किनारों पर नज़र रखता है, उनमें से हर एक पर बताता है कि आगे और है।

जो कंपोनेंट ख़ुद स्क्रॉल होता है — टेबल, डायलॉग का कॉन्टेंट, शीट — उसके चारों ओर इसकी ज़रूरत नहीं, न ही पेज के चारों ओर: पेज के अपने स्क्रॉल का कोई किनारा नहीं जिसे दिखाना हो। डायलॉग, शीट, पॉपओवर और ऐप बार वहाँ अपनी रेखा ख़ुद बनाते हैं जहाँ अपनी जगह टिका हिस्सा स्क्रॉल होते कॉन्टेंट से मिलता है।

स्क्रॉल एज चुनना

रूप किसके लिए
shadow अपारदर्शी सरफ़ेस: कॉन्टेंट उसमें डूबता है। पट्टी उस सरफ़ेस के रंग में बनती है जिस पर एरिया रखा है, अपने किसी ग्रे में नहीं। यह डिफ़ॉल्ट सिस्टम का चुनाव है।
fade एरिया के पीछे पारदर्शी सरफ़ेस, तस्वीर या वीडियो। कॉन्टेंट ख़ुद फ़ेड होता है और कोई रंग नहीं बनता, इसलिए पीछे जो है वह झलकता है।
line वह प्रॉडक्ट जो अपने किनारे रेखाओं से दिखाता है, और घना लेआउट जहाँ पट्टी कॉन्टेंट का बहुत हिस्सा ढक देती। रेखा डिवाइडर के रंग की बारीक रेखा है।
blur वह प्रॉडक्ट जिसके बार और किनारे पारभासी हैं: किनारे पर कॉन्टेंट नरम पड़ जाता है। इसे बनाने में सबसे ज़्यादा लागत आती है (नीचे देखें)।
none ऐसा बॉक्स जिसके किनारे जैसे हैं वैसे ही ठीक हैं, जैसे जिसका स्क्रॉल बार हमेशा दिखता है और काफ़ी है।

हर किनारा अलग से बनता है, और सिर्फ़ तब तक जब तक उसके आगे कॉन्टेंट हो: लिस्ट की शुरुआत में सिर्फ़ नीचे का किनारा दिखाया जाता है। यह बदलने पर किनारे का निशान धीरे-धीरे आता-जाता है, और जहाँ मोशन कम करें चालू हो, वहाँ तुरंत। निशान कभी एरिया का साइज़ नहीं बदलता और कभी कॉन्टेंट को नहीं खिसकाता।

edges बताता है कि किन किनारों पर नज़र रखी जाए: डिफ़ॉल्ट रूप से top और bottom, और बग़ल की ओर स्क्रॉल होने वाली पंक्ति के लिए start और end। बाएँ से दाएँ लेआउट में start बायाँ किनारा है, और दाएँ से बाएँ (RTL) लेआउट में दायाँ।

शैडो अपनी सरफ़ेस का रंग लेती है

शैडो सरफ़ेस के अपने रंग की एक पट्टी है जो कॉन्टेंट के ऊपर बिछती है, किनारे पर पूरी। जिस सरफ़ेस का रंग उसे दिया गया है, उस पर वह बिना किसी जोड़ के सरफ़ेस से मिल जाती है; किसी और सरफ़ेस पर वह ग़लत रंग के धब्बे जैसी दिखती है। comp.scroll-area.shadow.color डिफ़ॉल्ट रूप से सादी सरफ़ेस (sys.color.surface) है। जहाँ एरिया किसी और सरफ़ेस पर है — कार्ड, शीट, कोई कंटेनर रंग — वहाँ इसे उस सरफ़ेस का रंग दें: लेयर में, ताकि वहाँ रखे हर स्क्रॉल एरिया पर लागू हो, या सिर्फ़ उस एक इंस्टेंस पर। वेब पर यह --tanrei-comp-scroll-area-shadow-color कस्टम प्रॉपर्टी है, जो एलिमेंट पर या उसके किसी पूर्वज (ancestor) पर सेट की जाती है।

जहाँ एरिया के पीछे कुछ भी अपारदर्शी नहीं — पारभासी पैनल, तस्वीर, वीडियो — वहाँ कोई भी रंग सही नहीं। वहाँ 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 बताता है कि स्क्रॉल होने वाले बॉक्स का किनारा किससे दिखाया जाए, जब तक उस किनारे के आगे कॉन्टेंट हो: शैडो, फ़ेड, लाइन या ब्लर।

प्रॉडक्ट इन्हें अलग-अलग सेट कर सकता है: ऐसा डायलॉग जिसकी हेडर रेखा स्क्रॉल के साथ चलती है, और उसके बग़ल में लिस्ट जो अपनी सरफ़ेस में डूबती हैं।

प्लैटफ़ॉर्म का अपना स्क्रॉल बना रहता है

स्क्रॉल एरिया प्लैटफ़ॉर्म का अपना स्क्रॉल बॉक्स है, जिसके किनारों पर निशान बनाए गए हैं। व्हील, ट्रैकपैड, टच, कीबोर्ड, सहायक तकनीक और प्लैटफ़ॉर्म के स्क्रॉल बार वैसे ही काम करते हैं जैसे किसी और बॉक्स में, और स्क्रॉल बार का रूप प्लैटफ़ॉर्म का ही रहता है। एरिया अपनी ओर से न कोई स्क्रॉल जोड़ता है, न स्नैपिंग, न स्क्रॉल बार; वह भीतर कुछ लेआउट नहीं करता, और उसका न फ़िल है, न किनारा, न कोना। कॉन्टेंट को वैसे ही स्टाइल करें जैसे कहीं और करते।

करें

  • एरिया को उसका साइज़ अपने लेआउट में दें: एक ऊँचाई, ग्रिड का एक हिस्सा, हेडर और फ़ुटर के बाद बची जगह। उसे जो साइज़ दिया जाता है, वह वही लेता है।
  • जब भी एरिया सादी सरफ़ेस पर न हो, शैडो का रंग उस सरफ़ेस का रंग करें।
  • उसे ऐसा लेबल दें जो बताए कि उसमें क्या है: “संदेश”, “नतीजे”, “तस्वीरें”।

न करें

  • स्क्रॉल होने वाले किनारे पर अपना डिवाइडर, बॉर्डर या ग्रेडिएंट न बनाएँ। स्क्रॉल एज चुनें, ताकि वह सिर्फ़ तब दिखे जब किनारे के आगे कॉन्टेंट हो, और बाक़ी प्रॉडक्ट से मेल खाए।
  • तस्वीर, वीडियो या पारभासी सरफ़ेस के ऊपर शैडो इस्तेमाल न करें। फ़ेड इस्तेमाल करें।
  • एक स्क्रीन पर दो से ज़्यादा ब्लर किनारे न रखें।
  • एक ही दिशा में स्क्रॉल होने वाले स्क्रॉल एरिया एक-दूसरे के भीतर न रखें। व्यक्ति नहीं बता सकता कि स्वाइप किसे खिसकाएगा।
  • निशानों के लिए जगह बनाने को प्लैटफ़ॉर्म के स्क्रॉल बार न छिपाएँ। निशान बताते हैं कि और है; स्क्रॉल बार बताता है कि कितना, और वह अपने आप में एक कंट्रोल है।

सुलभता

रोल
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

कंपोनेंट क्या सँभालता है

  • जब तक उसका कॉन्टेंट नहीं समाता और भीतर कुछ भी कीबोर्ड फ़ोकस नहीं लेता, तब तक बॉक्स ख़ुद फ़ोकस के क्रम में एक पड़ाव बन जाता है, label के नाम वाले रीजन के रूप में, ताकि कीबोर्ड उसे स्क्रॉल कर सके (WCAG 2.1.1)। ऐरो कुंजियाँ, Page Up, Page Down, Home, End और Space उसे वैसे ही स्क्रॉल करती हैं जैसे प्लैटफ़ॉर्म किसी भी बॉक्स को।
  • जब भीतर कुछ फ़ोकस लेता है, या कॉन्टेंट समा जाता है, तब बॉक्स कोई पड़ाव नहीं होता और अपना कोई रोल नहीं देता: कीबोर्ड कॉन्टेंट तक पहुँचता है, और फ़ोकस मिलने पर कॉन्टेंट स्क्रॉल होकर नज़र में आ जाता है।
  • फ़ोकस इंडिकेटर बॉक्स के किनारे के भीतर, हर निशान के ऊपर बनता है, कोई निशान उसे कभी फ़ेड नहीं करता, और यह सिर्फ़ कीबोर्ड फ़ोकस पर दिखता है।
  • निशान सहायक तकनीक से छिपे रहते हैं, और उनके ऊपर हर दबाव, होवर और स्क्रॉल उनके नीचे के कॉन्टेंट तक पहुँचता है।
  • किनारे का निशान थोड़े समय में धीरे-धीरे आता-जाता है — यह अपारदर्शिता का बदलाव है, गति नहीं; जब मोशन कम करने का अनुरोध हो, तो वह तुरंत दिखता है।
  • फ़ोर्स्ड कलर्स में हर रूप टेक्स्ट के रंग की एक रेखा के रूप में बनता है।
  • इसके अपने कोई शब्द नहीं हैं। बॉक्स के पड़ाव होने पर ख़ाली लेबल, और अनजान scrollEdge या edges मान डीबग बिल्ड में रिपोर्ट किए जाते हैं।

आपको क्या करना है

  • उसे ऐसा label दें जो बताए कि उसमें क्या है। जो व्यक्ति Tab से बॉक्स तक पहुँचता है, वह यही नाम सुनता है; नाम के बिना उसे सिर्फ़ इतना सुनाई देता है कि यहाँ एक रीजन है।
  • मानकर चलें कि पट्टी के नीचे का कॉन्टेंट तब पढ़ा जाता है जब वह स्क्रॉल होकर नज़र में आता है, अपनी जगह पर नहीं। शैडो या फ़ेड अपने नीचे के कॉन्टेंट का कंट्रास्ट जान-बूझकर घटाते हैं, पर सिर्फ़ अपनी पट्टी के भीतर और सिर्फ़ तब तक जब तक वह कॉन्टेंट किनारे की ओर स्क्रॉल हुआ हो; नज़र में आते ही कॉन्टेंट पूरे कंट्रास्ट पर होता है।
  • जो कॉन्टेंट अपने आप बदलता है (लाइव लिस्ट, नए संदेश), उसकी सूचना वैसे ही दें जैसे कहीं और देते। एरिया स्क्रॉल होकर आने वाली चीज़ों को पढ़कर नहीं सुनाता।