बॉटम शीट
पूरक कॉन्टेंट या किसी छोटे काम को नीचे के किनारे से ऊपर लाती है, या तो स्क्रीन के निचले हिस्से के ऊपर जबकि बाक़ी स्क्रीन इस्तेमाल लायक़ रहती है, या एक ऐसे मोडल चरण के रूप में जो ख़ारिज किए जाने तक बाक़ी सब कुछ धुँधला करके रोके रखता है।
- श्रेणी
- कंटेनमेंट
- टोकन
comp.bottom-sheet- स्तर
- संयोजित
- इनसे बना है
- Modal layer
- Web
tanrei-bottom-sheetschedule - SwiftUI
tanreiBottomSheetschedule - Jetpack Compose
TanreiBottomSheetschedule - Flutter
TanreiBottomSheetschedule - React Native
BottomSheetschedule
इससे जनरेट किया गया: docs/status/status.json, specs/bottom-sheet.spec.json
एक मोडल शीट: इसे बटन से खोलें
चुनें कि फ़ोटो कहाँ सेव करनी है। आप इसे बाद में सेटिंग में बदल सकते हैं।
बॉटम शीट कंट्रोल्ड है, और वह कभी ख़ुद बंद नहीं होती। आप उसे open सेट करके खोलते हैं। जब व्यक्ति उसे हटाना चाहता है, तो शीट कारण के साथ close एमिट करती है, और आप open को वापस false करते हैं। SwiftUI अकेला अपवाद है: वहाँ open एक बाइंडिंग है, इसलिए शीट उसमें false लिखती है और फिर onClose को कॉल करती है। अगर आप open को true छोड़ देते हैं, तो शीट बनी रहती है, और ड्रैग के बाद अपनी सबसे कम ऊँचाई पर वापस टिक जाती है। वेब पर यह डायलॉग से अलग है: शीट नेटिव cancel इवेंट को रद्द करती है और उसकी जगह close एमिट करती है, इसलिए Escape उसे तब तक बंद नहीं करती जब तक आप न करें।
close के साथ पाँच में से एक कारण आता है, प्लैटफ़ॉर्म के अपने केसिंग में:
| कारण | व्यक्ति ने क्या किया | किस रूप में |
|---|---|---|
close |
शीट का बंद करने वाला बटन (closable) दबाया |
स्टैंडर्ड और मोडल |
drag |
ड्रैग को शीट की सबसे कम ऊँचाई के आधे से नीचे छोड़ा, या वहाँ से उसे नीचे की ओर फ़्लिंग किया | Standard और modal |
scrim |
मोडल शीट के आस-पास के धुँधले हिस्से को दबाया | Modal |
escape |
Escape दबाई | Modal |
back |
प्लैटफ़ॉर्म का बैक इस्तेमाल किया: Android का बैक बटन या जेस्चर, iOS का एक्सेसिबिलिटी एस्केप जेस्चर। वेब पर बंद करने का जो अनुरोध किसी कुंजी के बिना आता है, जैसे ब्राउज़र में Android का बैक जेस्चर, वह back है। |
Modal |
शीट close तभी एमिट करती है जब dismissible true हो, और हर अनुरोध के लिए ठीक एक बार। जब वह false है, तब स्क्रिम, Escape और बैक कुछ नहीं करते, और नीचे की ओर ड्रैग करने पर शीट सबसे कम ऊँचाई पर टिक जाती है। बंद करने वाला बटन इसका अपवाद है: dismissible कुछ भी हो, वह close कारण के साथ बंद करने को कहता है, क्योंकि यह वह रास्ता है जिसे आपने ख़ुद बनाना चुना।
variant पर शीट के दो रूप हैं। Modal, जो डिफ़ॉल्ट है, एक मोडल ओवरले है: वह पूरी विंडो को धुँधला करता है, फ़ोकस को भीतर रखता है, और बंद होने पर फ़ोकस लौटा देता है। Standard एक लेआउट रीजन है, ओवरले नहीं: वह उस पैरेंट के निचले हिस्से को ढकता है जिसमें आप उसे रखते हैं, कोई स्क्रिम नहीं बनाता, और व्यक्ति को अपने ऊपर के कॉन्टेंट में काम करते रहने देता है।
शीट में क्या जाएगा, यह आप तय करते हैं। शीट अपने कॉन्टेंट को अपनी पैडिंग जितना इनसेट देती है (जिस लिस्ट की पंक्तियाँ अपनी पैडिंग ख़ुद रखती हैं, उसके लिए inset को false करें), उसे क्लिप करती है, उसे कॉन्टेंट का रंग देती है और उसे स्क्रॉल करती है। उसे headline दें, तो वह कॉन्टेंट के ऊपर एक हेडर बनाती है: हेडलाइन, जो एक हेडिंग है और label ख़ाली होने पर शीट का नाम भी है, और closable चालू होने पर closeLabel के नाम वाला एक बंद करने वाला बटन, यानी एक small Button, जो डिफ़ॉल्ट सिस्टम में tonal है, जैसे Tanrei का हर बंद करने वाला बटन। हेडर के नीचे dividerVisibility के अनुसार एक डिवाइडर रहता है, और कॉन्टेंट स्क्रॉल होने पर भी हेडर अपनी जगह रहता है। closable डिफ़ॉल्ट रूप से बंद है, क्योंकि हैंडल और, मोडल शीट में, स्क्रिम शीट से बाहर निकलने के रास्ते हैं; स्टैंडर्ड शीट में या बिना हैंडल वाली शीट में इसे चालू करें।
जिस एलिमेंट को शीट खुलने पर फ़ोकस मिलना चाहिए, उस पर प्लैटफ़ॉर्म का अपना निशान लगाएँ: वेब पर autofocus, SwiftUI पर .defaultFocus या कोई @AccessibilityFocusState, Compose पर initialFocus के रूप में दिया गया FocusRequester, Flutter पर autofocus: true, और React Native पर initialFocusRef। निशान न हो, तो फ़ोकस ख़ुद शीट पर जाता है, इसलिए सबसे पहले उसका लेबल पढ़ा जाता है।
<tanrei-button id="save" variant="outlined">फ़ोटो सेव करें</tanrei-button>
<!-- मोडल डिफ़ॉल्ट है। closedby="none" का मतलब है dismissible को false करना। -->
<tanrei-bottom-sheet id="save-sheet" label="फ़ोटो सेव करें" handle-label="शीट का साइज़ बदलें">
<p>चुनें कि फ़ोटो कहाँ सेव करनी है।</p>
<tanrei-button variant="text" autofocus>हो गया</tanrei-button>
</tanrei-bottom-sheet>
<!-- स्टैंडर्ड: अपने कंटेनिंग ब्लॉक के निचले हिस्से को ढकती है। flush का मतलब है inset को false करना; no-handle का मतलब है handle को false करना। -->
<div class="map" style="position: relative">
<tanrei-bottom-sheet variant="standard" open label="आस-पास की जगहें" handle-label="शीट का साइज़ बदलें" flush>
<tanrei-list>…</tanrei-list>
</tanrei-bottom-sheet>
</div>
<script type="module">
import '@tanrei/web/components/bottom-sheet';
const sheet = document.querySelector('#save-sheet');
document.querySelector('#save').addEventListener('click', () => (sheet.open = true));
sheet.querySelector('tanrei-button').addEventListener('click', () => (sheet.open = false));
// शीट कभी ख़ुद बंद नहीं होती। detail.reason का मान drag, scrim, escape या back होता है।
sheet.addEventListener('close', (e) => (sheet.open = false));
// व्यक्ति ने इसे इसकी दूसरी ऊँचाई पर पहुँचाया। शीट detent पहले ही सेट कर चुकी है।
sheet.addEventListener('detentchange', (e) => console.log(e.detail.detent));
</script>import { BottomSheet, Button } from '@tanrei/react';
<BottomSheet
open={open}
label="फ़ोटो सेव करें"
handleLabel="शीट का साइज़ बदलें"
onClose={() => setOpen(false)}
onDetentChange={(e) => setDetent(e.detail.detent)}
>
<p>चुनें कि फ़ोटो कहाँ सेव करनी है।</p>
<Button variant="text" onClick={() => setOpen(false)}>हो गया</Button>
</BottomSheet>import Tanrei
// उस व्यू पर एक मॉडिफ़ायर जिसे शीट ढकती है, जैसे .sheet है। बंद होने पर बाइंडिंग में false लिखा जाता है,
// फिर कारण के साथ onClose कॉल होता है। व्यक्ति की चुनी हुई ऊँचाई detent में लिखी जाती है।
PhotoView(photo)
.tanreiBottomSheet(isPresented: $saving, detent: $detent,
handleLabel: "शीट का साइज़ बदलें", label: "फ़ोटो सेव करें") {
SaveTargets(photo)
TanreiButton("हो गया", variant: .text) { saving = false }
}
// स्टैंडर्ड: जिस व्यू को यह ढकती है, उसके निचले हिस्से पर एक ओवरले।
MapView()
.tanreiBottomSheet(isPresented: $placesShown, variant: .standard,
handleLabel: "शीट का साइज़ बदलें", label: "आस-पास की जगहें") {
PlacesList()
}import io.github.chnotchy.tanrei.components.TanreiBottomSheet
import io.github.chnotchy.tanrei.components.TanreiButton
import io.github.chnotchy.tanrei.tokens.TanreiButtonVariant
// इसे सिर्फ़ खुला रहने पर कॉल करने की जगह visible, ताकि बाहर जाने का मोशन चल सके।
// इसे onClose से false करें, जिसे कारण मिलता है।
TanreiBottomSheet(
visible = saving,
onClose = { saving = false },
detent = detent,
onDetentChange = { detent = it },
handleLabel = "शीट का साइज़ बदलें",
contentDescription = "फ़ोटो सेव करें",
) {
SaveTargets(photo)
TanreiButton(text = "हो गया", onClick = { saving = false }, variant = TanreiButtonVariant.Text)
}import 'package:tanrei/tanrei.dart';
// मोडल शीट पूरे पेज के ऊपर के Stack का आख़िरी चाइल्ड होती है। onClose से open को false करें।
Stack(
children: <Widget>[
const Positioned.fill(child: PhotoPage()),
TanreiBottomSheet(
open: saving,
onClose: (TanreiSheetCloseReason reason) => setState(() => saving = false),
detent: detent,
onDetentChanged: (value) => setState(() => detent = value),
handleSemanticLabel: 'शीट का साइज़ बदलें',
semanticLabel: 'फ़ोटो सेव करें',
child: const SaveTargets(),
),
],
),import { useRef, useState } from 'react';
import type { View } from 'react-native';
import { BottomSheet, Button } from '@tanrei/react-native';
const done = useRef<View>(null);
const [open, setOpen] = useState(false);
// कंट्रोल्ड: onClose से open को false करें, जिसे कारण मिलता है ('drag', 'scrim', 'escape' या 'back')।
// मोडल शीट एक पारदर्शी Modal में पेश की जाती है। शीट की insets प्रॉपर्टी में जो ओर दी गई हैं, उनके लिए वह TanreiProvider के इनसेट की जगह लेती है।
<BottomSheet
open={open}
onClose={(reason) => setOpen(false)}
detent={detent}
onDetentChange={setDetent}
handleLabel="शीट का साइज़ बदलें"
accessibilityLabel="फ़ोटो सेव करें"
initialFocusRef={done}
>
<SaveTargets />
<Button ref={done} variant="text" onPress={() => setOpen(false)}>हो गया</Button>
</BottomSheet>अपने पैरेंट के निचले हिस्से पर एक स्टैंडर्ड शीट: बंद करने के लिए इसे नीचे ड्रैग करें
संरचना
| भाग | विवरण |
|---|---|
1 scrim · वैकल्पिक | The modal layer's scrim over everything behind a modal sheet (MDL-1). It blocks presses and, while the sheet is dismissible, a press on it asks the sheet to close. A standard sheet draws none. |
2 container | The raised surface docked to the bottom edge of the area it covers, centred and no wider than its maximum width, its top corners rounded and its bottom corners square. Its color reaches under the bottom system inset. |
3 drag-handle · वैकल्पिक | The control at the top of the sheet: a Handle without a value, always drawn, that carries hover, focus and press on its box, with the grip centred in it. Activating it moves the sheet between its two heights. |
4 drag-handle.grip · वैकल्पिक | The Handle's line: the short rounded bar drawn in the handle's box that says the sheet can be dragged. |
5 header · वैकल्पिक | The row below the drag handle's row (or at the top without one) that holds the headline and the close button. Drawn while headline is not empty or closable is true; it stays in place while the content scrolls. |
6 headline · वैकल्पिक | What the sheet is about ("Share photo"), a heading. It names the sheet where label is empty. |
7 close-button · वैकल्पिक | An icon-only Button of the small size showing the close glyph at the end of the header, in the variant comp.bottom-sheet.close-button.variant names (tonal in the default system), as every host's close button is. The sheet places it and chooses its variant; everything else it reads from Button's own tokens. |
8 divider · वैकल्पिक | A hairline across the sheet below the header: drawn whenever the header is in the default system, or only while the content is scrolled away from its top under dividerVisibility scroll. |
9 content | Whatever the product puts in the sheet: a list of choices, a form, details. The sheet insets it (unless inset is false), clips it, hands it a content color and scrolls it; it does not lay it out. |
10 focus-ring · वैकल्पिक | Gap-then-ring indicator around the drag handle's box, shown for keyboard focus. |
प्रॉपर्टी
| प्रॉपर्टी | टाइप | डिफ़ॉल्ट | विवरण |
|---|---|---|---|
variant | standard | modal | "modal" | Standard sits over the lower part of the content while the content above stays usable (a layout region); modal dims and blocks everything else and holds focus until it closes (a modal overlay). Both read the same container tokens: the scrim and the behaviour set them apart. Not a token axis. |
open | boolean | false | Whether the sheet is shown. The product opens it, and closes it in answer to close (or from its own controls); on SwiftUI, where it is a binding, the sheet writes false itself. |
detent | partial | full | "partial" | The height the sheet rests at while its content is taller than it: partial takes comp.bottom-sheet.container.partial-fraction of the area; full reaches up to comp.bottom-sheet.container.margin-block-start below the area's top. A sheet whose content is shorter than its partial height has one height, and detent changes nothing. The person moves between the two by dragging or with the drag handle (detentChange). |
dismissible | boolean | true | Whether a drag below the sheet's lowest height asks it to close and, for a modal sheet, whether Escape, the platform's back and a press on the scrim do too. Set it to false only when the person must finish the sheet's task with one of its own controls. |
handle | boolean | true | Draws the drag handle at the top of the sheet. Without it the sheet can still be dragged by its padding and content (BSH-9), but a keyboard or switch user has no way to change its height, so leave it on for a sheet whose content can be taller than its partial height. |
handleLabel | string | "" | The drag handle's accessible name ("Resize sheet"); its expanded state is exposed with it. Required while the handle is interactive (BSH-11). |
inset | boolean | true | Insets the content by comp.bottom-sheet.container.padding. Set it to false for content that pads itself or reaches the edges (a list whose rows carry their own padding). |
label | string | "" | Names the sheet for assistive technology ("Share photo"): the modal dialog, or the standard sheet's region. Required unless headline names it. |
headline | string | "" | What the sheet is about ("Share photo"), drawn in its header (BSH-28). While label is empty it is the sheet's accessible name. |
closable | boolean | false | Draws the close button at the end of the header (BSH-29). False by default: the drag handle and, for a modal sheet, the scrim are the sheet's ways out. Set it where a person who cannot drag needs one they can see — a standard sheet, or a sheet without a handle. |
closeLabel | string | "" | The close button's accessible name ("Close sharing"). Required while closable is true. |
dividerVisibility | auto | always | scroll | "auto" | When the divider below the header is drawn. always: whenever the header is drawn, at rest as well as while the content is scrolled. scroll: only while the content is scrolled away from its top. auto takes comp.bottom-sheet.divider.visibility, the design system's answer (always in the default system). |
स्लॉट
| स्लॉट | विवरण |
|---|---|
default | The content. A fixture's content string is plain text, which takes sys.typescale.body in the content color (BSH-8). |
इवेंट
| इवेंट | विवरण |
|---|---|
close | The sheet asks to be closed: its close button (BSH-29), a released drag below its lowest height, or for a modal sheet a press on the scrim, Escape or the platform's back. Carries which of these it was, named close, drag, scrim, escape or back (in the platform's casing). The close button asks whatever dismissible says; the others only while dismissible is true. |
detentChange | The person moved the sheet to its other height, by a drag or with the drag handle. Carries the new detent (partial or full). Not emitted when the product sets detent. |
स्टेट
व्यवहार
EARS रूप में लिखी गई आवश्यकताएँ। हर प्लैटफ़ॉर्म के इम्प्लीमेंटेशन को इन ID के आधार पर टेस्ट किया जाता है। आवश्यकताओं का पाठ स्पेक फ़ाइल से ज्यों का त्यों, अंग्रेज़ी में दिखाया गया है।
| ID | आवश्यकता |
|---|---|
BSH-1 | WHEN open becomes true THE bottom sheet SHALL slide its container up from below the bottom edge of the area it covers to its height (BSH-6) — WHILE variant is modal over the whole window on its modal layer, fading the layer's scrim in comp.bottom-sheet.scrim.color and comp.bottom-sheet.scrim.blur in behind it in step (MDL-1, MDL-7); WHILE variant is standard over the bottom of the parent the product placed it in, with no scrim — over comp.bottom-sheet.motion.enter-duration with comp.bottom-sheet.motion.enter-easing; WHEN open becomes false THE bottom sheet SHALL slide it down out of view from wherever it is and fade the scrim out, over comp.bottom-sheet.motion.exit-duration with comp.bottom-sheet.motion.exit-easing. WHERE motion is reduced it SHALL fade in and out in place without sliding, or appear and disappear at once on a platform whose reduced-motion setting removes every animation (Android's). A sheet that is mounted with open true SHALL appear in place without motion. |
BSH-2 | WHILE variant is modal and the sheet is open THE bottom sheet SHALL make everything outside it inert, keep the content behind it from scrolling and keep focus inside it, as its modal layer does (MDL-2, MDL-4): a modal overlay. |
BSH-3 | WHEN open changes from false to true THE bottom sheet SHALL move focus to the element in it that the product marked for initial focus (the platform's own mark, named in the platform notes) or, without one, to its container, so that assistive technology reads its label first; WHEN it closes while focus is inside it THE bottom sheet SHALL return focus to the element that had it when the sheet opened or, where that element no longer exists or cannot take focus, to the platform's default for a closed overlay. Focus SHALL move when the sheet opens or closes, not when its motion ends. This holds for both variants (a modal sheet moves and returns focus as its modal layer does, MDL-3, MDL-5); a standard sheet mounted with open true SHALL NOT move focus, and a modal sheet mounted with open true SHALL move focus in as if it had just opened, because it makes everything behind it unfocusable and focus must be somewhere it can reach. |
BSH-4 | WHILE variant is standard THE bottom sheet SHALL draw no scrim, SHALL NOT make anything inert, SHALL NOT keep focus inside it, SHALL let Tab and Shift+Tab move focus between it and the content it covers without closing it, and SHALL ignore Escape and the platform's back: a standard sheet is a layout region, not an overlay. The product places it over the content it covers, in a parent that holds both; the sheet SHALL dock to that parent's bottom edge, SHALL NOT resize or pad the content, and SHALL let presses on the part of the parent above it reach the content. |
BSH-5 | WHILE dismissible is true, WHEN the user presses the scrim, presses Escape or uses the platform's back WHILE variant is modal, as its modal layer answers them (MDL-6), or releases a drag that asks to close (BSH-9) in either variant, THE bottom sheet SHALL emit close exactly once with the reason scrim, escape, back or drag, and SHALL then be closed: through its binding where open is one (SwiftUI), and by the product setting open to false where open is a plain value (web, Compose, Flutter, React Native). WHILE dismissible is false THE bottom sheet SHALL ignore these inputs and emit nothing for them (its close button, BSH-29, still asks); a press on the scrim SHALL still reach nothing behind it. |
BSH-6 | THE bottom sheet SHALL be as tall as its drag handle's row, its header (BSH-28) and its content (with its insets), but no taller than its detent allows: WHILE detent is partial, comp.bottom-sheet.container.partial-fraction of the height of the area it covers; WHILE detent is full, that height less comp.bottom-sheet.container.margin-block-start. The area is the window below its top system inset for a modal sheet, and the parent the product placed it in for a standard sheet; WHILE the on-screen keyboard is shown the area SHALL end at the keyboard's top edge, so that the sheet sits on the keyboard and both heights are taken from the smaller area. The sheet has two heights only WHILE its content is taller than its partial height; otherwise it has one, and detent changes nothing. |
BSH-7 | THE bottom sheet SHALL draw its container at the bottom edge of the area, as wide as the area but no wider than comp.bottom-sheet.container.max-width and centred in it, filled with comp.bottom-sheet.container.color, raised by comp.bottom-sheet.container.elevation, with its top corners rounded by comp.bottom-sheet.container.shape and its bottom corners square; it SHALL extend its color under the bottom system inset and keep its content above that inset, and WHILE the on-screen keyboard is shown it SHALL sit on the keyboard (BSH-6) with its content above it. |
BSH-8 | THE bottom sheet SHALL lay out, top to bottom, the drag handle's row WHILE handle is true (BSH-12), the header WHILE there is one (BSH-28) and then its content. WHILE inset is true it SHALL inset the content by comp.bottom-sheet.container.padding from its start, end and bottom edges, and from its top edge WHILE handle is false and no header is drawn; WHILE inset is false the content SHALL reach the container's edges, below the handle's row and the header. It SHALL clip the content to the container's shape, SHALL hand it comp.bottom-sheet.content.color as the platform's inherited foreground (the web's inherited color, SwiftUI's foreground style, Compose's content color, Flutter's default text and icon style, React Native's Tanrei text context), and plain text given as content, where the platform must style it, SHALL take sys.typescale.body. |
BSH-9 | WHEN the user drags the sheet vertically — by its handle's row, by the padding around its content, or by its content where BSH-10 lets the drag reach the sheet — beyond the platform's touch slop THE bottom sheet SHALL follow the finger or pointer, never above its full height; WHEN the drag is released it SHALL settle at the next height in the direction of a fling, or else at the height nearest to where it was released, over comp.bottom-sheet.motion.enter-duration with comp.bottom-sheet.motion.enter-easing (at once where motion is reduced). A release below half of the sheet's lowest height, or a downward fling from its lowest height, SHALL ask to close WHILE dismissible is true (BSH-5, BSH-20); WHILE dismissible is false the sheet SHALL settle at its lowest height instead. A fling is a release faster than the platform's minimum fling velocity (Android's ViewConfiguration.getScaledMinimumFlingVelocity, Flutter's kMinFlingVelocity) or, where the platform names none (the web, SwiftUI, React Native), 0.5 points per millisecond; the touch slop is the platform's own (Android's ViewConfiguration.getScaledTouchSlop, Flutter's kTouchSlop) or, where the platform names none, 8 points. A release's velocity is the pointer's over its last moves: WHERE the pointer has not moved for longer than the time after which the platform's velocity tracker takes a pointer as stopped (40 milliseconds in Android's VelocityTracker, Jetpack Compose's VelocityTracker and Flutter's VelocityTracker) or, where the platform names none (the web, SwiftUI, React Native), 40 milliseconds before the release THE bottom sheet SHALL take the release as having no velocity, so that a drag that stops where it is wanted and is let go there is no fling, however fast it moved before it stopped. WHEN a drag ends at the height it did not start from THE bottom sheet SHALL set detent to it and emit detentChange exactly once with it. |
BSH-10 | WHILE the content is taller than the room the sheet gives it THE bottom sheet SHALL scroll the content inside the container, below the handle's row, and SHALL let assistive technology and keyboard focus scroll it at either height; a drag upward on the content SHALL first raise the sheet to its full height and then scroll the content, and a drag downward on the content SHALL first scroll the content to its top and then lower the sheet. |
BSH-11 | WHILE handle is true and the sheet has two heights THE bottom sheet SHALL make the drag handle one focus stop, a button named by handleLabel with the expanded state, true WHILE detent is full (its label and expanded, HDL-8), and WHEN the user activates it by pointer, touch, Enter or Space (its activate, HDL-7) THE bottom sheet SHALL move to its other height as BSH-9 settles and emit detentChange exactly once with the new detent; WHILE the sheet has one height the handle SHALL still be drawn at rest but SHALL NOT be focusable, pressable or exposed to assistive technology. WHILE the handle is interactive and handleLabel is empty it SHALL still render, and in debug builds report that the handle has no accessible name. |
BSH-12 | WHILE handle is true THE bottom sheet SHALL draw at its top a row holding the drag handle — a Handle of axis vertical and size medium, with no value and revealed — centred across the sheet with comp.bottom-sheet.handle.margin-block above and below it, and SHALL give that Handle its own tokens in place of the Handle's: the box comp.bottom-sheet.handle.container-width wide and comp.bottom-sheet.handle.container-height high with comp.bottom-sheet.handle.container-shape corners (HDL-3), the grip — the Handle's line — comp.bottom-sheet.handle.grip-width long and comp.bottom-sheet.handle.grip-height thick (HDL-1), and the container, line and state-layer colors of each state from the drag-handle control (comp.bottom-sheet.drag-handle.container.color, comp.bottom-sheet.drag-handle.grip.color, comp.bottom-sheet.drag-handle.state-layer.color, and so on for each state), its opacity in each state, and comp.bottom-sheet.motion.state-duration, comp.bottom-sheet.motion.state-easing and comp.bottom-sheet.motion.feedback-duration as its motion; in the default system each of them aliases the Handle's own. The row SHALL stay in place while the content scrolls. |
BSH-13 | WHILE the drag handle is hovered, keyboard-focused or pressed THE bottom sheet SHALL render the handle's box, grip and opacity from the component tokens of the highest-precedence active state, with precedence pressed over focused over hovered, and the grip at the Handle's length and thickness of a handle in use (HDL-4); focus gained by pointer or touch SHALL NOT select the focused state. A drag that starts on the handle SHALL keep it pressed while the sheet follows the drag, as a Handle is held for as long as a drag lasts (HDL-11). |
BSH-14 | WHEN the drag handle receives keyboard focus THE bottom sheet SHALL show the focus ring around the handle's box without animation; focus gained by pointer or touch SHALL NOT show it. |
BSH-15 | THE bottom sheet SHALL give the drag handle the Handle's hit area (HDL-5): at least sys.target.touch wide and high for touch input and sys.target.pointer for fine pointers, centred on its box, without changing its drawn size, and the Handle's vertical resize cursor; a platform that cannot tell the input type SHALL use sys.target.touch. A press on the rest of the handle's row drags the sheet as BSH-9 says. |
BSH-16 | WHEN the drag handle is pressed by pointer, touch, Enter or Space THE drag handle SHALL show the pressed state without delay and SHALL keep it visible for at least sys.motion.duration.press-hold, even when the press ends sooner (HDL-11). |
BSH-17 | WHILE pressed THE drag handle SHALL answer as sys.behavior.pressed-feedback names: overlay applies the pressed tokens to the whole container at once; ripple grows the pressed state layer from the point of contact (from the center for keyboard activation); dim applies the pressed opacity to the whole control and draws no state layer; none draws no answer to the press. Under ripple and dim only the container color stays with the state under the press; grip and opacity still come from the pressed tokens. Under none every part stays with the state under the press. The ripple grows over comp.bottom-sheet.motion.feedback-duration with comp.bottom-sheet.motion.state-easing, fades over comp.bottom-sheet.motion.state-duration with comp.bottom-sheet.motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced. |
BSH-18 | THE bottom sheet SHALL ease its container's top corners and the drag handle's box corners by sys.shape.corner-smoothing (0 is a quarter circle, 0.6 the iOS continuous corner; a platform with only the OS curve draws it for any amount above 0) and show the handle's keyboard focus as sys.behavior.focus-style names (ring or glow); a platform that cannot draw a choice SHALL fall back to the first value and state that in its README. |
BSH-19 | WHEN the drag handle's colors, or its grip's length and thickness, change between states THE bottom sheet SHALL animate them over comp.bottom-sheet.motion.state-duration with comp.bottom-sheet.motion.state-easing, and SHALL change them at once where motion is reduced. |
BSH-20 | WHEN a released drag asks to close THE bottom sheet SHALL emit close (BSH-5), hold where the drag left it for one frame, and then slide out from there as BSH-1 says IF open has become false, or settle back at its lowest height as BSH-9 says IF open is still true (the product declined to close it). |
BSH-21 | WHEN the product changes detent while the sheet is open THE bottom sheet SHALL move to the new height over comp.bottom-sheet.motion.enter-duration with comp.bottom-sheet.motion.enter-easing (at once where motion is reduced) and SHALL NOT emit detentChange; where detent is a plain value (web, Compose, Flutter, React Native), a height the person chose (BSH-9, BSH-11) SHALL stay until the product sets detent again, and where it is a binding (SwiftUI) the sheet SHALL write the new detent to it. |
BSH-22 | THE bottom sheet SHALL expose its container, WHILE variant is modal, as a modal dialog named by label and, WHILE variant is standard, as a region named by label (a landmark on the web) — by the headline WHILE label is empty (BSH-28); WHILE label and headline are both empty it SHALL still render, and in debug builds report that it has no accessible name. The drag handle's grip, the Handle's line, SHALL be hidden from assistive technology; the handle itself is exposed only as BSH-11 says. |
BSH-23 | WHEN a dialog, a menu or another modal sheet opens from a modal bottom sheet THE bottom sheet SHALL stay below it, become inert with the rest of the window, and on the other overlay's closing receive back the focus that overlay returns, as its modal layer does (MDL-8, MDL-9); Escape SHALL dismiss only the topmost overlay. |
BSH-24 | WHILE the text size is enlarged THE bottom sheet SHALL grow with its content up to the height its detent allows and scroll the content beyond it (BSH-10), grow its header with a headline that wraps, and SHALL NOT scale the drag handle, nor the close button beyond what the Button itself does. |
BSH-25 | WHEN variant or detent names a value the bottom sheet does not define THE bottom sheet SHALL render with the default value, and in debug builds report the unknown value. |
BSH-26 | WHEN the layout direction is right-to-left THE bottom sheet SHALL keep its container and its drag handle centred, and its content SHALL follow the layout direction. |
BSH-27 | THE bottom sheet 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 bottom sheet is shown THE bottom sheet SHALL draw itself for the new direction at once, without a motion of its own, keeping its open state, its height and its focus. |
BSH-28 | WHILE headline is not empty or closable is true THE bottom sheet SHALL draw a header below the drag handle's row (or at the top of the container without one): a row at least comp.bottom-sheet.header.height high holding the headline from comp.bottom-sheet.container.padding after the start edge, in comp.bottom-sheet.headline.typescale and comp.bottom-sheet.headline.color, wrapping onto more lines rather than truncating and growing the row with it, exposed as a heading, and, WHILE closable is true, the close button ending comp.bottom-sheet.header.padding-inline-end before the end edge and comp.bottom-sheet.header.gap after the headline, both centred in the row; below it, a divider comp.bottom-sheet.divider.width thick in comp.bottom-sheet.divider.color across the sheet's full width WHILE dividerVisibility (or, for auto, comp.bottom-sheet.divider.visibility) is always, or is scroll and the content is scrolled away from its top, shown and hidden at once. The header SHALL NOT scroll with the content, and a drag on it SHALL move the sheet as a drag on the handle's row does (BSH-9). WHILE headline is not empty it SHALL name the sheet where label is empty. A dividerVisibility the sheet does not define SHALL be drawn as auto, and reported in debug builds. |
BSH-29 | WHILE closable is true THE bottom sheet SHALL draw its close button as an icon-only Button of the small size showing the glyph close of the system's icon set and named by closeLabel, in the variant comp.bottom-sheet.close-button.variant names, given through the channel a Button reads from the component that places it, and otherwise unrestyled: it reads Button's own tokens, answers hover, focus and press as any Button does and keeps its own minimum target (BTN-5); WHEN the user activates it THE bottom sheet SHALL emit close exactly once with the reason close, in either variant and whatever dismissible says, and SHALL then be closed as BSH-5 says. WHILE closable is true and closeLabel is empty it SHALL still draw the button, and in debug builds report that the button has no accessible name. THE bottom sheet SHALL draw no close mark of its own. |
BSH-30 | WHILE handle is false, dismissible is true and closable is false THE bottom sheet SHALL still render, and in debug builds report that it shows no way out a person can see: a drag, Escape and the scrim still close it, but nothing on screen says so to a person who cannot drag. |
BSH-31 | 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 bottom sheet 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 container (BSH-22) — its dialog WHILE variant is modal, its region otherwise — an id reference by the elements it names in the host's tree or a tree around it, a description after its own. WHILE label or headline is not empty it is the container's name (BSH-22), over a name given so; WHILE both are empty, a name given so is the container's name and SHALL NOT be reported as having none 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 bottom sheet SHALL take it off that element. |
प्लैटफ़ॉर्म के अनुसार नामों का मिलान
पैरिटी का मतलब एक जैसे API नहीं है। हर प्लैटफ़ॉर्म एक ही कॉन्ट्रैक्ट को अपने तरीक़े से व्यक्त करता है।
| स्पेक | Web | SwiftUI | Jetpack Compose | Flutter | React Native |
|---|---|---|---|---|---|
| कंपोनेंट | tanrei-bottom-sheet | tanreiBottomSheet | TanreiBottomSheet | TanreiBottomSheet | BottomSheet |
variant · प्रॉपर्टी | variant | variant | variant | variant | variant |
open · प्रॉपर्टी | open | isPresented | visible | open | open |
detent · प्रॉपर्टी | detent | detent | detent | detent | detent |
dismissible · प्रॉपर्टी | closedby | dismissible | dismissible | dismissible | dismissible |
handle · प्रॉपर्टी | handle | handle | handle | showHandle | handle |
handleLabel · प्रॉपर्टी | handleLabel | handleLabel | handleLabel | handleSemanticLabel | handleLabel |
inset · प्रॉपर्टी | inset | inset | inset | inset | inset |
label · प्रॉपर्टी | label | label | contentDescription | semanticLabel | accessibilityLabel |
headline · प्रॉपर्टी | headline | headline | headline | headline | headline |
closable · प्रॉपर्टी | closable | closable | closable | showCloseButton | closable |
closeLabel · प्रॉपर्टी | closeLabel | closeLabel | closeLabel | closeButtonSemanticLabel | closeLabel |
dividerVisibility · प्रॉपर्टी | dividerVisibility | dividerVisibility | dividerVisibility | dividerVisibility | dividerVisibility |
close · इवेंट | close | onClose | onClose | onClose | onClose |
detentChange · इवेंट | detentchange | detent | onDetentChange | onDetentChanged | onDetentChange |
| टिप्पणियाँ | dismissible is HTML's own closedby attribute, as on <tanrei-dialog>: any (the default) or none. handle and inset are boolean properties that default to true; their attributes are the inverses no-handle and flush (an HTML boolean attribute cannot default to true). handleLabel is the handle-label attribute, closeLabel the close-label attribute and dividerVisibility the divider-visibility attribute (auto reads --tanrei-comp-bottom-sheet-divider-visibility from the cascade with a style query, and where the browser has none the sheet writes the name it read on its header when it renders). The close button is a <tanrei-button> in the shadow root, icon-only (the close glyph in its icon slot, its label from close-label), whose variant comes from the resolved comp.bottom-sheet.close-button.variant through the internal channel a Button reads from its host; the headline is an <h2>. close is a CustomEvent whose detail.reason is close, drag, scrim, escape or back (back when a modal sheet's native cancel arrives without an Escape key, as Android's back gesture sends it), and detentchange one whose detail.detent is the new detent; the element sets detent itself before firing it. The product sets open to false from close. The content is the default slot. Drags use pointer events with touch-action: none on the handle's row and the top edge; the content scrolls natively and hands the drag over at its top (BSH-10). Fling 0.5 px/ms, slop 8 px. Insets are env(safe-area-inset-bottom); the on-screen keyboard is read from visualViewport. Snapshot harness: a 400 × 720 viewport with a surface page; the sheet opened by open; the screenshot is the viewport, since a modal sheet and its backdrop are in the top layer. The drag handle is a <tanrei-handle> in the shadow root, its container and line exported as the parts handle and grip; the sheet sets the Handle's custom properties to its own tokens on it (BSH-12), answers its activate, and keeps it inert while the sheet has one height (BSH-11). | A view modifier on the view the sheet covers, as .sheet is: .tanreiBottomSheet(isPresented: Binding<Bool>, variant:, detent: Binding<TanreiBottomSheetDetent>, dismissible:, handle:, handleLabel:, inset:, label:, onClose: ((TanreiSheetCloseReason) -> Void)?, content:). Closing writes false to isPresented and then calls onClose with the reason; a height the person chose is written to detent (detentChange). Modal: on iOS presented with .fullScreenCover, a clear presentation background and the system transition off, as tanreiDialog is (that presentation hides the rest of the app from VoiceOver); Tanrei draws the scrim, the sheet and the drag with a DragGesture (fling from its velocity, 0.5 pt/ms). Not the native .sheet: its dim cannot take the scrim token, and on iPad in a regular width it becomes a centred form, not a bottom sheet. macOS, which has no full-screen cover, draws the modal sheet as an overlay of the modified view with the modal trait. Standard: .overlay(alignment: .bottom) of the modified view. Initial focus is .defaultFocus or an @AccessibilityFocusState the product passes; Escape is .onKeyPress(.escape) and the escape gesture .accessibilityAction(.escape). Snapshot harness: renders TanreiBottomSheetSurface (the sheet and, for a modal sheet, the scrim) in place in a 400 × 720 frame over a surface page, because a snapshot of the presenting view does not include a presented window. Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). | TanreiBottomSheet(visible, onClose: (TanreiSheetCloseReason) -> Unit, variant, detent, onDetentChange, dismissible, handle, handleLabel, inset, contentDescription, initialFocus: FocusRequester?, content). visible rather than calling it only while open, so that the exit motion can run before the sheet goes; the caller sets visible to false from onClose. The sheet keeps a height the person chose until detent changes (BSH-21). Modal: drawn in a Dialog window of its own, as TanreiDialog and the modal drawer are, with usePlatformDefaultWidth = false, decorFitsSystemWindows = false and the window's own dim off (Tanrei draws the scrim); the window traps focus, answers back and hides the content behind from TalkBack; the sheet sets a pane title from contentDescription. Standard: fills its parent (a Box over the content) and draws the sheet at its bottom edge; the part above takes no touches. Drag with Modifier.draggable and nested scroll for BSH-10; fling and slop from ViewConfiguration. Snapshot harness: renders TanreiBottomSheetContent (the sheet and, for a modal sheet, the scrim) in place in a 400 × 720 dp box over a surface page; the window itself is covered by instrumented tests. Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). | TanreiBottomSheet(variant:, open:, onClose: ValueChanged<TanreiSheetCloseReason>, detent:, onDetentChanged:, dismissible:, showHandle:, handleSemanticLabel:, inset:, semanticLabel:, child:), controlled: the caller sets open to false from onClose. The product places it in a Stack over what it covers — for a modal sheet, a Stack over the whole page, as the modal navigation drawer — not showModalBottomSheet, which needs Material. The modal form draws its scrim over the whole Stack, keeps focus in a FocusScope, blocks the page's semantics (BlockSemantics), names itself with Semantics(scopesRoute: true, namesRoute: true), answers back through PopScope and Escape through Shortcuts/Actions. Initial focus is autofocus: true on a focusable widget. Drag with a vertical drag recogniser; fling kMinFlingVelocity, slop kTouchSlop. Snapshot harness: a golden of the whole 400 × 720 surface with the sheet in a Stack over a surface page. Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). | Controlled: open, onClose(reason), detent, onDetentChange; the caller sets open to false from onClose. Modal: presented in a transparent Modal with animationType="none", statusBarTranslucent and navigationBarTranslucent (Tanrei draws the scrim and the motion); onRequestClose (Android back, and Escape on a hardware keyboard) is close with the reason back or escape. Standard: a View positioned absolutely at the bottom of its parent. Drags with PanResponder (no gesture-handler dependency): slop 8 pt, fling 0.5 pt/ms. The on-screen keyboard is read from Keyboard events. Initial focus is an initialFocusRef the product passes, moved with AccessibilityInfo.setAccessibilityFocus. Insets come from the sheet's own insets prop, falling back to TanreiProvider's insets; the package takes no safe-area dependency. Snapshot harness: renders BottomSheetSurface (the sheet and, for a modal sheet, the scrim) in place in a 400 × 720 view over a surface page, since a Modal is a native window the snapshot does not include. React Native cannot hand one gesture from the sheet to the content's native scroll view partway through, so BSH-10's hand-off takes two gestures there; the package takes no gesture-handler dependency (as it takes no safe-area one). Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). |
टोकन
| टोकन | किसका एलियास | रिज़ॉल्व किया गया मान (लाइट) |
|---|---|---|
--tanrei-comp-bottom-sheet-close-button-variant | — | 1 |
--tanrei-comp-bottom-sheet-container-color | sys.color.surface-container-low | |
--tanrei-comp-bottom-sheet-container-elevation | sys.elevation.level2 | 0px 0px 0px 1px rgb(0 0 0 / 0.08), 0px 1px 2px 0px rgb(0 0 0 / 0.04) |
--tanrei-comp-bottom-sheet-container-margin-block-start | sys.space.space600 | 48px |
--tanrei-comp-bottom-sheet-container-max-width | — | 640px |
--tanrei-comp-bottom-sheet-container-padding | sys.space.space200 | 16px |
--tanrei-comp-bottom-sheet-container-partial-fraction | — | 0.5 |
--tanrei-comp-bottom-sheet-container-shape | sys.shape.corner.large | 12px |
--tanrei-comp-bottom-sheet-content-color | sys.color.on-surface | |
--tanrei-comp-bottom-sheet-divider-color | sys.color.outline-variant | |
--tanrei-comp-bottom-sheet-divider-visibility | sys.behavior.divider-visibility | 0 |
--tanrei-comp-bottom-sheet-divider-width | sys.border.hairline | 1px |
--tanrei-comp-bottom-sheet-drag-handle-container-color | comp.handle.standard.container.color | |
--tanrei-comp-bottom-sheet-drag-handle-focused-container-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-focused-grip-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-focused-state-layer-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-grip-color | comp.handle.standard.line.color | |
--tanrei-comp-bottom-sheet-drag-handle-hovered-container-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-hovered-grip-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-hovered-state-layer-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-pressed-container-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-pressed-grip-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-pressed-state-layer-color | — | |
--tanrei-comp-bottom-sheet-drag-handle-state-layer-color | comp.bottom-sheet.drag-handle.grip.color | |
--tanrei-comp-bottom-sheet-focused-opacity | — | 1 |
--tanrei-comp-bottom-sheet-handle-container-height | comp.handle.container.breadth.medium | 24px |
--tanrei-comp-bottom-sheet-handle-container-shape | comp.handle.container.shape | 9999px |
--tanrei-comp-bottom-sheet-handle-container-width | comp.handle.container.length.medium | 48px |
--tanrei-comp-bottom-sheet-handle-grip-height | comp.handle.line.thickness.medium | 4px |
--tanrei-comp-bottom-sheet-handle-grip-width | comp.handle.line.length.medium | 32px |
--tanrei-comp-bottom-sheet-handle-margin-block | sys.space.space150 | 12px |
--tanrei-comp-bottom-sheet-header-gap | sys.space.space100 | 8px |
--tanrei-comp-bottom-sheet-header-height | — | 64px |
--tanrei-comp-bottom-sheet-header-padding-inline-end | sys.space.space150 | 12px |
--tanrei-comp-bottom-sheet-headline-color | sys.color.on-surface | |
--tanrei-comp-bottom-sheet-hovered-opacity | — | 1 |
--tanrei-comp-bottom-sheet-motion-enter-duration | sys.motion.role.appear.sheet.enter | 400ms |
--tanrei-comp-bottom-sheet-motion-enter-easing | sys.motion.easing.enter | cubic-bezier(0.2, 0, 0, 1) |
--tanrei-comp-bottom-sheet-motion-exit-duration | sys.motion.role.appear.sheet.exit | 350ms |
--tanrei-comp-bottom-sheet-motion-exit-easing | sys.motion.easing.exit | cubic-bezier(0.3, 0, 1, 1) |
--tanrei-comp-bottom-sheet-motion-feedback-duration | comp.handle.motion.feedback-duration | 450ms |
--tanrei-comp-bottom-sheet-motion-state-duration | comp.handle.motion.state-duration | 200ms |
--tanrei-comp-bottom-sheet-motion-state-easing | comp.handle.motion.state-easing | cubic-bezier(0.2, 0, 0, 1) |
--tanrei-comp-bottom-sheet-pressed-opacity | — | 1 |
--tanrei-comp-bottom-sheet-scrim-blur | comp.modal-layer.scrim.blur | 0px |
--tanrei-comp-bottom-sheet-scrim-color | comp.modal-layer.scrim.color | |
--tanrei-comp-bottom-sheet-headline-typescale | sys.typescale.heading-5 | 500 16px/1.5 |
फ़िक्स्चर
मानक रेंडरिंग। हर प्लैटफ़ॉर्म हर फ़िक्स्चर का स्नैपशॉट एक ही ID से लेता है, ताकि नतीजों की तुलना की जा सके।
modal
open: true handleLabel: Resize sheet label: Save photo 400 × 720 की विंडो में अलग से बनाया गयाmodal-partial
open: true detent: partial handleLabel: Resize sheet label: Terms of service 400 × 720 की विंडो में अलग से बनाया गयाmodal-full
open: true detent: full handleLabel: Resize sheet label: Terms of service 400 × 720 की विंडो में अलग से बनाया गयाno-handle
open: true handle: false label: Save photo 400 × 720 की विंडो में अलग से बनाया गयाstandard
variant: standard open: true handleLabel: Resize sheet label: Nearby places 400 × 720 की विंडो में अलग से बनाया गयाmodal-header
open: true handleLabel: Resize sheet headline: Save photo closable: true closeLabel: Close 400 × 720 की विंडो में अलग से बनाया गयाno-handle-header
open: true handle: false headline: Save photo closable: true closeLabel: Close 400 × 720 की विंडो में अलग से बनाया गयाstandard-header
variant: standard open: true handleLabel: Resize sheet label: Cafés and bakeries nearby headline: Nearby places closable: true closeLabel: Close nearby places 400 × 720 की विंडो में अलग से बनाया गयाइससे जनरेट किया गया: specs/bottom-sheet.spec.json, tokens/comp/bottom-sheet.tokens.json, design/tokens/
बॉटम शीट कॉम्पैक्ट स्क्रीन पर इस्तेमाल करें, जहाँ कॉन्टेंट के बग़ल में जगह नहीं होती, किसी ऐसी चीज़ के लिए जो स्क्रीन की है पर उसका मुख्य विषय नहीं है: नक़्शे के किसी बिंदु के आस-पास की जगहें, फ़ोटो शेयर करने के तरीक़े, कोई छोटा चुनाव या फ़ॉर्म। शीट उस किनारे से उठती है जो अँगूठे के सबसे पास है।
चौड़ी विंडो पर उसी तरह के कॉन्टेंट के लिए साइड शीट इस्तेमाल करें, जहाँ वह कॉन्टेंट के ऊपर नहीं, उसके बग़ल में रह सकती है। जिस फ़ैसले के बिना काम आगे नहीं बढ़ सकता, उसके लिए डायलॉग इस्तेमाल करें। प्रॉडक्ट के गंतव्यों के लिए बॉटम शीट नहीं, नेविगेशन ड्रॉअर इस्तेमाल करें।
मुख्य क्रिया से कई क्रियाएँ। जब किसी स्क्रीन की मुख्य क्रिया कुछ मिलते-जुलते रूपों में आती है (नया दस्तावेज़, फ़ोल्डर या अपलोड), तो मुख्य ऐक्शन बटन एक मोडल बॉटम शीट खोलता है जिसमें उनकी लिस्ट होती है। Tanrei सिस्टम में यह FAB मेन्यू की जगह लेती है, जिसे वह सिस्टम नहीं देता।
मुख्य क्रिया से कई क्रियाएँ: शीट को बटन से खोलें
| रूप | यह क्या है | किसके लिए |
|---|---|---|
| Modal (डिफ़ॉल्ट) | एक मोडल ओवरले। शीट एक ऐसे स्क्रिम के ऊपर स्लाइड होकर आती है जो पूरी विंडो को धुँधला करता है। उसके बाहर की हर चीज़ निष्क्रिय रहती है, और उसके बंद होने तक फ़ोकस भीतर रहता है। | वह चरण जिसे व्यक्ति वापस जाने से पहले पूरा करता है या ख़ारिज करता है: शेयर करना, कोई चुनाव, छोटा फ़ॉर्म। |
| Standard | एक लेआउट रीजन। शीट बिना स्क्रिम के अपने पैरेंट के निचले हिस्से को ढकती है, और उसके ऊपर का कॉन्टेंट इस्तेमाल लायक़ रहता है। Tab शीट और कॉन्टेंट के बीच चलती है, और फ़ोकस के शीट से बाहर जाने पर वह कभी बंद नहीं होती। | वह कॉन्टेंट जिसे व्यक्ति स्क्रीन के साथ-साथ इस्तेमाल करता है, जैसे नक़्शे के ऊपर जगहों की लिस्ट। |
दोनों रूप एक ही टोकन पढ़ते हैं: उन्हें सिर्फ़ स्क्रिम और व्यवहार अलग करते हैं, इसलिए कोई डिज़ाइन सिस्टम उन्हें अलग-अलग रूप नहीं देता।
लेआउट रीजन हैं स्टैंडर्ड नेविगेशन ड्रॉअर (उसका सिमटा हुआ रूप भी), ऐप बार और स्टैंडर्ड साइड शीट, जो सब कॉन्टेंट के बग़ल में या उसके ऊपर रहते हैं। स्टैंडर्ड बॉटम शीट इनके उलट अपने पैरेंट के एक हिस्से को ढकती है, पर वह भी लेआउट रीजन है, क्योंकि मायने व्यवहार के हैं: वह मोडल नहीं है, कोई स्क्रिम नहीं बनाती, और उसके खुला रहते कॉन्टेंट इस्तेमाल लायक़ रहता है। जो शीट फ़ोकस के बाहर जाते ही बंद हो जाती, उसे कीबोर्ड से उस नक़्शे के साथ इस्तेमाल नहीं किया जा सकता था जिसका वह वर्णन करती है।
स्टैंडर्ड शीट जिस चीज़ को ढकती है, उसे न खिसकाती है, न उसमें पैडिंग जोड़ती है। अगर आपके स्क्रॉल होने वाले कॉन्टेंट का अंत शीट के ऊपर दिखते रहना ज़रूरी है, तो उस कॉन्टेंट में शीट की आंशिक ऊँचाई जितनी पैडिंग दें।
detent के दो मान हैं। partial पर शीट उस क्षेत्र का एक हिस्सा लेती है जिसे वह ढकती है, डिफ़ॉल्ट टोकन के साथ आधा। full पर वह क्षेत्र के ऊपरी सिरे से नीचे एक छोटे मार्जिन तक पहुँचती है। मोडल शीट के लिए यह क्षेत्र ऊपरी इनसेट के नीचे की विंडो है, और स्टैंडर्ड शीट के लिए पैरेंट। जब तक ऑन-स्क्रीन कीबोर्ड दिख रहा है, क्षेत्र कीबोर्ड पर ख़त्म होता है, इसलिए शीट उसके ऊपर टिकती है।
शीट उतनी ही ऊँची होती है जितना उसका कॉन्टेंट। जिस शीट का कॉन्टेंट आंशिक ऊँचाई में समा जाता है, उसकी एक ही ऊँचाई होती है, और detent कुछ नहीं बदलता। जब कॉन्टेंट उससे ऊँचा होता है, तब शीट की दो ऊँचाइयाँ होती हैं, और व्यक्ति ड्रैग करके या ड्रैग हैंडल से उनके बीच आता-जाता है। ऐसा हर बदलाव नई ऊँचाई के साथ detentChange एमिट करता है। वेब, Compose, Flutter और React Native पर शीट व्यक्ति की चुनी हुई ऊँचाई तब तक बनाए रखती है जब तक आप detent फिर से सेट नहीं करते। SwiftUI पर वह ऊँचाई को detent बाइंडिंग में लिखती है। detent को ख़ुद सेट करने पर शीट खिसकती है, पर कुछ एमिट नहीं करती।
ड्रैग हैंडल शीट के ऊपरी सिरे की छोटी पट्टी है, एक ऐसी पंक्ति में जो कॉन्टेंट के स्क्रॉल होने पर भी अपनी जगह रहती है। handle चालू हो, तो यह हर शीट पर बनता है।
- एक कंट्रोल, जब जाने को कोई जगह हो। जब शीट की दो ऊँचाइयाँ होती हैं, तब हैंडल
handleLabelके नाम वाला एक बटन होता है, जिसका expanded स्टेट पूरी ऊँचाई पर लागू होता है। दबाना, Enter या Space शीट को उसकी दूसरी ऊँचाई पर ले जाती हैं। जब शीट की एक ही ऊँचाई होती है, तब हैंडल सामान्य अवस्था में इस संकेत के रूप में बनता है कि शीट को ड्रैग किया जा सकता है, पर उस पर न फ़ोकस जा सकता है, न उसे दबाया जा सकता है, और सहायक तकनीक उसे नहीं देखती। - इसका टार्गेट। हैंडल के आर-पार की पूरी पंक्ति उसका हिट एरिया है, हर दिशा में कम से कम न्यूनतम टार्गेट जितना, हालाँकि पट्टी ख़ुद छोटी है।
- ड्रैग करना। व्यक्ति शीट को हैंडल की पंक्ति से, कॉन्टेंट के आस-पास की पैडिंग से, या ख़ुद कॉन्टेंट से ऊपर-नीचे ड्रैग कर सकता है। जब उँगली या पॉइंटर प्लैटफ़ॉर्म के टच स्लॉप से आगे बढ़ जाता है (जहाँ प्लैटफ़ॉर्म कोई मान नहीं देता वहाँ 8 पॉइंट), तब शीट उसके साथ चलती है, और कभी अपनी पूरी ऊँचाई से ऊपर नहीं उठती।
- छोड़ना। छोड़ने पर, फ़्लिंग की गई शीट अपनी दिशा की अगली ऊँचाई पर टिकती है, और धीरे छोड़ी गई शीट सबसे नज़दीकी ऊँचाई पर। फ़्लिंग वह छोड़ना है जो प्लैटफ़ॉर्म के न्यूनतम फ़्लिंग वेग से तेज़ हो, या जहाँ प्लैटफ़ॉर्म कोई मान नहीं देता वहाँ 0.5 पॉइंट प्रति मिलीसेकंड से तेज़।
- बंद करने के लिए ड्रैग करना। सबसे कम ऊँचाई के आधे से नीचे छोड़ना, या सबसे कम ऊँचाई से नीचे की ओर फ़्लिंग करना, शीट से
dragकारण के साथ बंद होने को कहता है, बशर्तेdismissibletrue हो। शीट एक फ़्रेम के लिए वहीं रुकती है जहाँ ड्रैग ने उसे छोड़ा, फिर अगर आपनेopenको false किया तो स्लाइड होकर बाहर जाती है, और नहीं किया तो वापस टिक जाती है। जबdismissiblefalse है, तब वह अपनी सबसे कम ऊँचाई पर टिकती है। - स्क्रॉल होने वाला कॉन्टेंट। कॉन्टेंट पर ऊपर की ओर का ड्रैग पहले शीट को पूरी ऊँचाई तक उठाता है, फिर कॉन्टेंट को स्क्रॉल करता है। नीचे की ओर का ड्रैग पहले कॉन्टेंट को वापस उसके ऊपरी सिरे तक स्क्रॉल करता है, फिर शीट को नीचे करता है। जहाँ प्लैटफ़ॉर्म एक ही जेस्चर को शीट से कॉन्टेंट के स्क्रॉल को नहीं सौंप सकता, वहाँ दूसरे हिस्से के लिए दूसरा ड्रैग लगता है (नीचे प्लैटफ़ॉर्म की ज्ञात कमियाँ देखें)। कीबोर्ड और सहायक तकनीक कॉन्टेंट को दोनों ऊँचाइयों पर स्क्रॉल कर सकते हैं।
ड्रैग करना कभी अकेला तरीक़ा नहीं होता। हैंडल एक बार दबाने से या कीबोर्ड से ऊँचाई बदलता है, और मोडल शीट स्क्रिम, Escape या बैक से भी बंद होती है। स्टैंडर्ड शीट के पास, और उस मोडल शीट के पास जिसका dismissible false है, बंद होने का ऐसा कोई दूसरा तरीक़ा नहीं होता, इसलिए उसे बंद करने वाला एक बटन दें।
- खुलना। शीट नीचे के किनारे के नीचे से स्लाइड होकर ऊपर आती है। मोडल शीट उसी समय पूरी विंडो पर अपना स्क्रिम फ़ेड करके लाती है। जो शीट
openके पहले से true रहते दिखाई जाती है, वह बिना मोशन के अपनी जगह दिखती है। स्टैंडर्ड शीट तब फ़ोकस को वहीं छोड़ देती है जहाँ वह है। मोडल शीट फ़ोकस को भीतर ले जाती है, मानो वह अभी खुली हो, क्योंकि उसके पीछे की कोई चीज़ अब फ़ोकस नहीं ले सकती। - फ़ोकस का भीतर जाना। खुलने पर फ़ोकस उस एलिमेंट पर जाता है जिस पर आपने निशान लगाया है, या ख़ुद शीट पर, दोनों रूपों में। फ़ोकस शीट के खुलते ही जाता है, उसका मोशन ख़त्म होने पर नहीं।
- फ़ोकस का भीतर रहना, सिर्फ़ मोडल में। मोडल शीट में फ़ोकस पा सकने वाले आख़िरी एलिमेंट से Tab पहले पर जाती है, और पहले से Shift+Tab आख़िरी पर। स्क्रीन रीडर का नेविगेशन भीतर रहता है, और पीछे का कॉन्टेंट स्क्रॉल नहीं होता। स्टैंडर्ड शीट कुछ नहीं रोकती: Tab आगे कॉन्टेंट पर बढ़ जाती है, और शीट खुली रहती है।
- बंद होना। जब शीट ऐसे समय बंद होती है कि फ़ोकस उसके भीतर है, तो फ़ोकस उस एलिमेंट पर लौटता है जिस पर वह शीट खुलते समय था।
- एक के ऊपर एक। किसी मोडल शीट से खोला गया डायलॉग, मेन्यू या दूसरी मोडल शीट उसके ऊपर आती है। Escape सिर्फ़ सबसे ऊपर वाले को ख़ारिज करती है, और वह ओवरले जो फ़ोकस लौटाता है, वह शीट को वापस मिलता है।
- मोशन। जहाँ मोशन कम किया गया है, वहाँ शीट बिना स्लाइड हुए अपनी जगह पर फ़ेड होकर आती और जाती है। Android पर, जिसकी सेटिंग हर ऐनिमेशन हटा देती है, वह तुरंत दिखती और ग़ायब होती है।
- शीट का काम साफ़ नज़र में रखें: कॉन्टेंट के ऊपर एक शीर्षक, और जब शीट के पास बंद होने का कोई और तरीक़ा न हो तो “हो गया” या “बंद करें” बटन।
- जिस लिस्ट की पंक्तियों की अपनी पैडिंग है, उसके लिए
insetबंद करें, ताकि पंक्तियाँ किनारों तक पहुँचें। - जिस शीट का कॉन्टेंट उसकी आंशिक ऊँचाई से ऊँचा हो सकता है, उस पर हैंडल चालू रहने दें, ताकि कीबोर्ड और स्विच इस्तेमाल करने वाले लोग उसकी ऊँचाई बदल सकें।
- जब शीट के खुला रहते व्यक्ति को उसके ऊपर के कॉन्टेंट की ज़रूरत हो, तो स्टैंडर्ड रूप इस्तेमाल करें।
dismissibleको false न करें, जब तक कि व्यक्ति के लिए शीट का काम उसके अपने किसी कंट्रोल से पूरा करना अनिवार्य न हो।- जिस फ़ैसले के लिए व्यक्ति को रोकना ज़रूरी है, उसके लिए मोडल शीट इस्तेमाल न करें। डायलॉग इस्तेमाल करें।
- प्रॉडक्ट का नेविगेशन बॉटम शीट में न रखें। नेविगेशन ड्रॉअर या नेविगेशन बार इस्तेमाल करें।
- चरणों वाले काम के लिए शीट पर शीट न चढ़ाएँ। उसकी जगह एक ही शीट का कॉन्टेंट बदलें।
- रोल
dialog- लेबलिंग
- The sheet is named by label, or by its headline where label is empty: a modal dialog while variant is modal, a region while it is standard. The headline is a heading; the close button is named by closeLabel; the divider is decorative. The drag handle, while the sheet has two heights, is a button named by handleLabel with the expanded state (true at full height); at one height it is hidden. The grip is decorative.
- न्यूनतम टार्गेट
- दिखने वाला आकार छोटा होने पर भी हिट एरिया न्यूनतम टार्गेट साइज़ को पूरा करता है। minimum 32px · pointer 44px · spacing 8px · touch 48px
कीबोर्ड
| कुंजियाँ | क्रिया |
|---|---|
| Tab / Shift+Tab | Moves focus through the drag handle (while it is interactive), the close button (while closable is true) and the content's focusable elements, in that order. In an open modal sheet it wraps and never leaves the sheet; from a standard sheet it moves on to the content, and the sheet stays open. |
| Enter / Space | On the drag handle, moves the sheet to its other height (partial or full). On the close button, asks the sheet to close (close, reason close). |
| Escape | Asks an open modal sheet to close (close, reason escape) while dismissible is true; with stacked overlays, only the topmost. A standard sheet ignores it. |
टिप्पणियाँ
- Dragging is never the only way (WCAG 2.5.7): the drag handle changes the height with a single press or from the keyboard, and a modal sheet closes with Escape, back or a press on the scrim. A standard sheet, and a modal one whose dismissible is false, closes only by a drag, its close button or the product: set closable, or put a Close or Done button in its content.
- The standard form is a layout region, although it covers the bottom of the content rather than pushing it aside: the person works in the content and in the sheet at once, so focus leaving it never closes it. The modal form is a modal overlay.
- Web: the modal form is a native <dialog> opened with showModal() inside the shadow root, so the rest of the page is inert and the sheet is in the top layer; ::backdrop draws the scrim. Its cancel event (Escape) is cancelled and becomes close with the reason escape; the product then sets open to false. The standard form is a region (a <section> named by label) positioned at the bottom of its containing block. The `autofocus` attribute on a slotted element marks initial focus.
- Where a platform presents the modal sheet in a window of its own (Compose's Dialog, React Native's Modal), the window's own dim and transition are switched off and Tanrei draws the scrim and the motion, so every platform draws the same color.
- The sheet does not move or pad the content a standard sheet covers; a product whose content must stay visible above the sheet pads its scrolling content by the sheet's partial height.
- How a state looks is a value decision of the active design system; components read the state's tokens and never compute the effect themselves.
इससे जनरेट किया गया: specs/bottom-sheet.spec.json, tokens/sys/measure.tokens.json
- मोडल शीट सहायक तकनीक को
labelके नाम वाले मोडल डायलॉग के रूप में मिलती है, औरlabelख़ाली हो तोheadlineके नाम वाले। स्टैंडर्ड शीट इसी तरह नाम पाने वाला एक रीजन है, जो वेब पर एक लैंडमार्क है। - हेडलाइन एक हेडिंग है। बंद करने वाला बटन
closeLabelके नाम वाला Tanrei का सिर्फ़ आइकन वाला Button है, जिसका न्यूनतम टारगेट, फ़ोकस रिंग और स्टेट Button के अपने हैं; दोनों रूपों में,dismissibleकुछ भी हो, वह शीट सेcloseकारण के साथ बंद होने को कहता है। हेडर के नीचे का डिवाइडर सजावटी है। - जब तक मोडल शीट खुली है, उसके बाहर की हर चीज़ निष्क्रिय रहती है और सहायक तकनीक से छिपी रहती है, और फ़ोकस और स्क्रीन रीडर का नेविगेशन उसके भीतर रहते हैं। स्टैंडर्ड शीट किसी चीज़ को निष्क्रिय नहीं करती।
- खुलने पर फ़ोकस उस एलिमेंट पर जाता है जिस पर आपने निशान लगाया है, या शीट पर। बंद होने पर फ़ोकस उस एलिमेंट पर लौटता है जिस पर वह शीट खुलते समय था। यह दोनों रूपों पर लागू है।
- जब तक
dismissibletrue है, Escape, प्लैटफ़ॉर्म का बैक और स्क्रिम पर दबाना मोडल शीट से बंद होने को कहते हैं। स्टैंडर्ड शीट Escape और बैक को अनदेखा करती है। - ड्रैग हैंडल एक साइज़ हैंडल है, जो हमेशा बनता है और शीट के अपने टोकन लेता है। जब शीट की दो ऊँचाइयाँ होती हैं, तब यह
handleLabelके नाम वाला, फ़ोकस पा सकने वाला एक बटन होता है, जो पूरी ऊँचाई पर expanded होता है। Enter और Space शीट को उसकी दूसरी ऊँचाई पर ले जाती हैं। एक ही ऊँचाई होने पर हैंडल सहायक तकनीक से छिपा रहता है। ग्रिप हमेशा छिपी रहती है। - हैंडल का हिट एरिया कम से कम न्यूनतम टार्गेट जितना है, और उसकी फ़ोकस रिंग सिर्फ़ कीबोर्ड फ़ोकस के लिए दिखती है।
- कॉन्टेंट शीट के भीतर स्क्रॉल होता है, और कीबोर्ड फ़ोकस और सहायक तकनीक उसे दोनों ऊँचाइयों पर स्क्रॉल कर सकते हैं।
- बड़ा टेक्स्ट शीट को उसके कॉन्टेंट के साथ बढ़ाता है, उस ऊँचाई तक जिसकी उसका detent अनुमति देता है, और उससे आगे कॉन्टेंट स्क्रॉल होता है। हैंडल का साइज़ नहीं बढ़ता।
- शीट का रंग नीचे के सिस्टम इनसेट के नीचे तक पहुँचता है, और उसका कॉन्टेंट उस इनसेट के और ऑन-स्क्रीन कीबोर्ड के ऊपर रहता है।
- डीबग बिल्ड ऐसी शीट की रिपोर्ट करते हैं जिसमें न
labelहो नheadline, बिनाhandleLabelवाले इंटरैक्टिव हैंडल की, बिनाcloseLabelवाले बंद करने वाले बटन की, ऐसी शीट की जिसमें न हैंडल है न बंद करने वाला बटन फिर भी जिसे हटाया जा सकता है (स्क्रीन पर कुछ नहीं बताता कि कैसे), और अनजानvariant,detentयाdividerVisibilityकी।
प्लैटफ़ॉर्म की ज्ञात कमियाँ:
- कॉन्टेंट पर माउस का ड्रैग शीट को वैसे ही चलाता है जैसे टच चलाता है, इसलिए जब तक शीट चल सकती है, उसके टेक्स्ट को नीचे की ओर ड्रैग करके चुना नहीं जा सकता।
- SwiftUI, Compose, Flutter और React Native अभी हेडर नहीं बनाते:
headline,closable,closeLabelऔरdividerVisibility, औरcloseकारण, अभी सिर्फ़ वेब पर हैं। - Web: टच पर ब्राउज़र जेस्चर शुरू होते ही तय कर लेता है कि उसे कौन लेगा, इसलिए शीट और कॉन्टेंट के स्क्रॉल के बीच जेस्चर सौंपने के लिए दूसरा जेस्चर लगता है। माउस या पेन एक ही ड्रैग के भीतर सौंप देता है। टच से ड्रैग करना अभी किसी टेस्ट में शामिल नहीं है। Firefox में शीट स्लाइड होकर बाहर जाने की जगह तुरंत चली जाती है, जैसे डायलॉग।
- SwiftUI में न डायलॉग का रोल है, न रीजन का: शीट
labelके नाम वाला एक कंटेनर है, जिस पर मोडल रहने पर मोडल ट्रेट होता है। हैंडल का कोई expanded स्टेट नहीं है, इसलिए उसका मान “expanded” या “collapsed” कहता है, सिर्फ़ अंग्रेज़ी में। जब किसी पर निशान न हो, तो SwiftUI फ़ोकस को ख़ुद शीट पर नहीं ले जा सकता, और बंद होने पर कीबोर्ड फ़ोकस किसी को नहीं लौटाता; iOS पर मोडल कवर VoiceOver का फ़ोकस लौटा देता है। macOS पर मोडल शीट सिर्फ़ उस व्यू को ढकती है जिससे मॉडिफ़ायर जुड़ा है, इसलिए उसे विंडो के रूट से जोड़ें। - iOS पर SwiftUI: पूरी ऊँचाई से नीचे, कॉन्टेंट पर ड्रैग शीट को उठाता है और अगला ड्रैग स्क्रॉल करता है, और वहाँ कॉन्टेंट स्क्रॉल नहीं होता, VoiceOver या कीबोर्ड के लिए भी नहीं। कॉन्टेंट का सादा टेक्स्ट बॉडी फ़ॉन्ट लेता है पर उसकी लाइन हाइट नहीं, इसलिए दो पंक्तियाँ 40 पॉइंट ऊँची होती हैं जहाँ बाक़ी प्लैटफ़ॉर्म 44 बनाते हैं।
- SwiftUI: नीचे का इनसेट और ऑन-स्क्रीन कीबोर्ड, हार्डवेयर कीबोर्ड, Escape और iOS का एस्केप जेस्चर न किसी डिवाइस पर चलाए गए हैं, न उन्हें दबाकर टेस्ट किया गया है।
- Compose: शीट अपने कॉन्टेंट को ख़ुद स्क्रॉल करती है, इसलिए उसे लेज़ी लिस्ट नहीं, एक सादा कॉलम दें। जब मोडल शीट बंद हो रही होती है, तो बाहर जाने का मोशन ख़त्म होने तक उसकी विंडो फ़ोकस रखे रहती है। उसके ड्रैग सिर्फ़ Robolectric में जाँचे गए हैं, किसी डिवाइस पर नहीं।
- Flutter: स्टैंडर्ड शीट नाम वाला एक कंटेनर है, रीजन लैंडमार्क नहीं, क्योंकि Flutter 3.32 में ऐसा कोई रोल नहीं है। शीट को अभी किसी डिवाइस पर TalkBack और VoiceOver के साथ जाँचा नहीं गया है।
- React Native यह नहीं बता सकता कि फ़ोकस किस एलिमेंट पर था, इसलिए शीट बंद होने पर फ़ोकस वहाँ जाता है जहाँ प्लैटफ़ॉर्म उसे रखता है, उस एलिमेंट पर वापस नहीं जिसने उसे खोला था, जैसा डायलॉग और नेविगेशन ड्रॉअर के साथ है।
initialFocusRefके बिना खुलने पर सिर्फ़ स्क्रीन रीडर का फ़ोकस शीट पर जाता है। - React Native एक जेस्चर को बीच में शीट से कॉन्टेंट के स्क्रॉल को नहीं सौंप सकता, इसलिए उस ड्रैग का बाक़ी हिस्सा बेकार जाता है और अगला ड्रैग स्क्रॉल करता है। Modal, ड्रैग, कीबोर्ड से बचना और इनसेट सिर्फ़ Jest में जाँचे गए हैं, किसी डिवाइस पर कभी नहीं।
cupertinoमें ग्रिप Apple के हल्के आउटलाइन रंग में बनती है और शीट के मुक़ाबले लाइट स्कीम में 1.8:1 और डार्क स्कीम में 2.2:1 मापी जाती है, जो उस 3:1 से कम है जिसकी किसी कंट्रोल की सीमा को ज़रूरत होती है। मध्यम और उच्च कंट्रास्ट वाली स्कीम इसे 4.5:1 या उससे ऊपर ले आती हैं। जो दो आँकड़े कम पड़ते हैं, वे जानकारी के तौर पर रखे गए माप हैं: नक़ल करने वाले प्रीसेट पर Tanrei के सुलभता मानदंड लागू नहीं होते।m3-likeमें पूरी ऊँचाई वाली शीट डिफ़ॉल्ट सिस्टम का ऊपरी मार्जिन रखती है: Material का मान इस इंतज़ार में है कि फ़िडेलिटी रेफ़रेंस में बॉटम शीट शामिल हो।
- हर शीट को एक
labelयाheadlineदें, जैसे “फ़ोटो सेव करें”। यही डायलॉग या रीजन का नाम है। - हैंडल को एक
handleLabelदें, जैसे “शीट का साइज़ बदलें”, अपने प्रॉडक्ट की भाषा में। - शीट को ख़ुद बंद करें:
closeके जवाब मेंopenको false करें (वेब परcloseइवेंट, Compose, Flutter और React Native परonClose), और अपने “हो गया” या “बंद करें” बटन से भी। SwiftUI पर शीट आपके लिए बाइंडिंग में false लिख देती है। - स्टैंडर्ड शीट को, और उस मोडल शीट को जिसका
dismissiblefalse है, बंद करने वाला एक दिखने वाला बटन दें: शीट का अपना बंद करने वाला बटन (closable,closeLabelके साथ) या आपका अपना कोई बटन। ड्रैग करना बाहर निकलने का अकेला रास्ता नहीं होना चाहिए। - जहाँ मदद मिले, वहाँ शुरुआती फ़ोकस का निशान लगाएँ, जैसे किसी छोटे फ़ॉर्म के पहले फ़ील्ड पर।
- React Native पर
initialFocusRefदें, शीट बंद होने के बाद फ़ोकस को ख़ुद उसे खोलने वाले एलिमेंट पर लौटाएँ, और विंडो के इनसेट शीट केinsetsको याTanreiProviderको दें।