चेकबॉक्स
लोगों को एक स्वतंत्र चुनाव चालू या बंद करने देता है, ऐसा पैरेंट चुनाव दिखाता है जो सिर्फ़ आंशिक रूप से चालू है, और उस ज़रूरी चुनाव को चिह्नित करता है जो किया नहीं गया।
- श्रेणी
- चयन
- टोकन
comp.checkbox- स्तर
- आधार
- इनमें उपयोग
- Checkbox group
- Web
tanrei-checkboxschedule - SwiftUI
TanreiCheckboxschedule - Jetpack Compose
TanreiCheckboxschedule - Flutter
TanreiCheckboxschedule - React Native
Checkboxschedule
इससे जनरेट किया गया: docs/status/status.json, specs/checkbox.spec.json
चेक नहीं किया हुआ, चेक किया हुआ और अनिश्चित
जिस संशोधन ने चेकबॉक्स को उसके मौजूदा साइज़ और आइकन सेट के ग्लिफ़ दिए, उसने सिर्फ़ यह बदला कि वह कैसा दिखता और कैसे चलता है, इसलिए नीचे का हर उदाहरण मौजूदा है। वेब इसे वैसे ही बनाता और ऐनिमेट करता है जैसा स्पेक कहता है। SwiftUI, Compose, Flutter और React Native पीछे हैं: वे नए साइज़ पहले से लेते हैं, पर जब तक बराबरी पर नहीं आते, चेक और डैश को अपने ही निशानों के रूप में बनाते हैं और अपने तरीक़े से ऐनिमेट करते हैं। उसके बाद के दो सुधार अभी सिर्फ़ वेब पर हैं: चेक और डैश का अपना, ज़्यादा भारी वेट है, और बॉक्स की आउटलाइन और फ़िल एक ही शेप के रूप में बनते हैं।
<tanrei-checkbox label="मुझे अपडेट ईमेल करें"></tanrei-checkbox>
<tanrei-checkbox checked label="मुझे अपडेट ईमेल करें"></tanrei-checkbox>
<!-- ऐसा पैरेंट जिसके चाइल्ड मिले-जुले हैं। सक्रिय करने पर यह चेक हो जाता है और indeterminate हट जाता है। -->
<tanrei-checkbox indeterminate label="सभी चुनें"></tanrei-checkbox>
<!-- फ़ॉर्म में, चेक रहने पर यह name के तहत value (डिफ़ॉल्ट "on") सबमिट करता है, और required का पालन करता है। -->
<form>
<tanrei-checkbox name="terms" required label="मुझे शर्तें स्वीकार हैं"></tanrei-checkbox>
</form>
<script type="module">
import '@tanrei/web/components/checkbox';
// एलिमेंट change फ़ायर करने से पहले अपना checked ख़ुद बदलता है।
document.querySelector('tanrei-checkbox').addEventListener('change', (e) => save(e.detail.checked));
const terms = document.querySelector('[name="terms"]');
terms.error = submitted && !terms.checked;
</script>import { Checkbox } from '@tanrei/react';
<Checkbox checked={updates} label="मुझे अपडेट ईमेल करें" onChange={(e) => setUpdates(e.detail.checked)} />
<Checkbox checked={all} indeterminate={some && !all} label="सभी चुनें" onChange={(e) => selectAll(e.detail.checked)} />
<Checkbox checked={terms} error={submitted && !terms} label="मुझे शर्तें स्वीकार हैं" onChange={(e) => setTerms(e.detail.checked)} />import Tanrei
TanreiCheckbox("मुझे अपडेट ईमेल करें", isOn: $updates)
// isIndeterminate आपके डेटा से आता है। सक्रिय करने पर isOn true हो जाता है; फिर आपका डेटा उसे हटा देता है।
TanreiCheckbox("सभी चुनें", isOn: $allSelected, isIndeterminate: someSelected)import androidx.compose.ui.state.ToggleableState
import io.github.chnotchy.tanrei.components.TanreiCheckbox
TanreiCheckbox(checked = updates, onCheckedChange = { updates = it }, label = "मुझे अपडेट ईमेल करें")
// जो पैरेंट आंशिक रूप से चालू हो सकता है, वह ToggleableState लेता है। अगला स्टेट कॉलर निकालता है:
// अनिश्चित चेकबॉक्स को सक्रिय करने पर वह On हो जाता है।
TanreiCheckbox(
state = allState,
onClick = { selectAll(allState != ToggleableState.On) },
label = "सभी चुनें",
)
TanreiCheckbox(
checked = terms,
onCheckedChange = { terms = it },
label = "मुझे शर्तें स्वीकार हैं",
isError = submitted && !terms,
)import 'package:tanrei/tanrei.dart';
TanreiCheckbox(
value: updates,
onChanged: (bool value) => setState(() => updates = value), // null इसे अक्षम कर देता है
label: 'मुझे अपडेट ईमेल करें',
);
// tristate के साथ null मान अनिश्चित है। सक्रिय करने पर onChanged(true) कॉल होता है।
TanreiCheckbox(
value: allSelected, // bool?: जब तक सिर्फ़ कुछ चुने हैं, null
tristate: true,
onChanged: (bool value) => setState(() => selectAll(value)),
label: 'सभी चुनें',
);
TanreiCheckbox(
value: terms,
onChanged: (bool value) => setState(() => terms = value),
isError: submitted && !terms,
label: 'मुझे शर्तें स्वीकार हैं',
);import { Checkbox } from '@tanrei/react-native';
<Checkbox value={updates} onValueChange={setUpdates} label="मुझे अपडेट ईमेल करें" />
<Checkbox value={all} indeterminate={some && !all} onValueChange={selectAll} label="सभी चुनें" />
<Checkbox value={terms} onValueChange={setTerms} error={submitted && !terms} label="मुझे शर्तें स्वीकार हैं" />अवस्थाएँ, त्रुटि और अक्षम
डिफ़ॉल्ट सिस्टम में चेकबॉक्स 2 की आउटलाइन और 2 के कोने वाला 18 का बॉक्स है, 40 की गोल स्टेट लेयर पर, 48 के टार्गेट के साथ। लेबल के साथ इसकी ऊँचाई 40 है। चेक और डैश सिस्टम के आइकन सेट के check और remove ग्लिफ़ हैं, जो बॉक्स के ऊपर 20 पर बनते हैं। उनका अपना वेट है, जो सिस्टम के बाक़ी आइकन से भारी है: डिफ़ॉल्ट सिस्टम में 500, जहाँ आइकन 300 के हैं। इस साइज़ पर आइकन के वेट वाला स्ट्रोक लगभग एक पिक्सल चौड़ा होता है और मुश्किल से दिखता है, इसलिए निशान भारी है जबकि उसका साइज़ वही रहता है। प्रीसेट अपना आइकन वेट बनाए रखता है। चेकबॉक्स अपना कोई निशान नहीं बनाता, इसलिए जो डिज़ाइन सिस्टम अपना आइकन सेट बदलता है, वह बाक़ी सभी ग्लिफ़ के साथ इन्हें भी बदल देता है। बॉक्स की आउटलाइन और फ़िल एक ही शेप हैं: किसी भी ज़ूम या डिस्प्ले डेंसिटी पर बॉक्स के पीछे की कोई चीज़ उनके बीच से नहीं झाँकती, और चेक किया हुआ बॉक्स अपने किनारे से अपने निशान तक एक ही समान रंग का होता है। cupertino में चेकबॉक्स अपना छोटा बॉक्स और 16 का ग्लिफ़ बनाए रखता है।
जब चेकबॉक्स बदलता है, तो बॉक्स, आउटलाइन और ग्लिफ़ का रंग बदलता है, और जो ग्लिफ़ आता है वह अपने आधे साइज़ से बढ़ते हुए फ़ेड होकर आता है, और हल्के ओवरशूट के साथ टिकता है। जो ग्लिफ़ जाता है वह उसी तरह फ़ेड होकर सिकुड़ता है, और चेक किए हुए और अनिश्चित के बीच चेक जाता है जबकि डैश आता है। सिर्फ़ ग्लिफ़ चलता है: बॉक्स का साइज़ या जगह कभी नहीं बदलती। पहली बार बनाया गया चेकबॉक्स अपनी अवस्था तुरंत दिखाता है, इसलिए जो पेज टिक किए हुए बॉक्स के साथ लोड होता है, वह उन्हें ऐनिमेट नहीं करता। जहाँ मोशन कम किया गया है, वहाँ नई अवस्था अगले फ़्रेम में पूरी बना दी जाती है।
संरचना
संरचना
unselected बनाता है, उसी के ऊपर बनाया गया।| भाग | विवरण |
|---|---|
1 container | The round state layer behind the box (Material Design 3's 40). It carries hover, focus and press and is invisible at rest. |
2 box | The small square that shows the condition (Material Design 3's 18, with a 2 corner): empty with an outline when unchecked, filled when checked or indeterminate. |
3 outline | The border of the box, drawn inside its edge. The fill sits inside the border, so a translucent fill and border never overlap; where the two meet they are drawn as one shape, so nothing behind the box shows between them. |
4 mark | The glyph check (checked) or the glyph remove (indeterminate) of the system's icon set, centered on the box and drawn with the icon set's family, fill and optical size at the mark's own weight, comp.checkbox.mark.weight: in the default system heavier than the system's icons, because the mark is a thin stroke on a small filled box and is what tells checked from indeterminate. The checkbox draws no mark of its own; a system that wants another check chooses another icon set. The glyph is decorative: the condition is announced from the state. |
5 label · वैकल्पिक | The visible text that names the choice. A click on it toggles the checkbox. |
6 focus-ring | Gap-then-ring indicator shown for keyboard focus, following the box's shape. |
माप
माप
| लंबाई | टोकन | मान (px) |
|---|---|---|
container size | tanrei.comp.checkbox.container.size | 40 |
box size | tanrei.comp.checkbox.box.size | 18 |
mark size | tanrei.comp.checkbox.mark.size | 20 |
unselected बनाता है, उसी के ऊपर बनाया गया।प्रॉपर्टी
| प्रॉपर्टी | टाइप | डिफ़ॉल्ट | विवरण |
|---|---|---|---|
checked | boolean | false | Whether the choice is on. |
indeterminate | boolean | false | Shows the choice as partly on (a parent whose children are mixed). Wins over checked for what is drawn and announced; activation clears it. |
error | boolean | false | Marks the choice as invalid (a required choice left unmade). Draws the error form of the condition and is exposed as invalid; the message itself belongs to the surrounding form. |
disabled | boolean | false | Prevents interaction and removes the checkbox from the focus order. |
readOnly | boolean | false | Shows the choice and keeps it: the checkbox can be focused and read and is submitted with its form, but the person cannot switch it. Drawn as an enabled checkbox, without the hover and press answers (CHK-24). |
label | string | "" | The text that names the choice: drawn next to the box and used as the accessible name. |
labelHidden | boolean | false | Draws no visible label but keeps label as the accessible name (a row-selection checkbox in a table whose row already says what it is). |
इवेंट
| इवेंट | विवरण |
|---|---|
change | The user switched the checkbox; carries the new value of checked (indeterminate is then false). |
स्टेट
व्यवहार
EARS रूप में लिखी गई आवश्यकताएँ। हर प्लैटफ़ॉर्म के इम्प्लीमेंटेशन को इन ID के आधार पर टेस्ट किया जाता है। आवश्यकताओं का पाठ स्पेक फ़ाइल से ज्यों का त्यों, अंग्रेज़ी में दिखाया गया है।
| ID | आवश्यकता |
|---|---|
CHK-1 | WHEN the user activates the checkbox by pointer, touch, Space, assistive technology or a click on its label THE checkbox SHALL switch checked and emit change exactly once with the new value; Enter SHALL activate it only on a platform whose convention activates any focused control with Enter (Android, tvOS), and SHALL NOT on the web, where Enter submits the form. |
CHK-2 | WHEN the user activates the checkbox while indeterminate is true THE checkbox SHALL set checked to true, clear indeterminate, and emit change with true. |
CHK-3 | WHILE disabled is true THE checkbox SHALL NOT change or emit change, SHALL NOT be focusable, SHALL ignore clicks on its label and SHALL expose the disabled state to assistive technology. |
CHK-4 | THE checkbox SHALL draw the condition its props select: indeterminate when indeterminate is true, otherwise selected when checked is true, otherwise unselected; and the error- form of that condition while error is true. |
CHK-5 | WHILE hovered, keyboard-focused or pressed THE checkbox SHALL render its container, box, mark, outline, label and opacity from the component tokens of its condition in the highest-precedence active state, with precedence pressed over focused over hovered; focus gained by pointer or touch SHALL NOT select the focused state. A part the interaction states recolor changes over the component's state motion, as the container does; only a change of condition uses the selection motion. |
CHK-6 | WHEN the checkbox receives keyboard focus THE checkbox SHALL show the focus ring around its box without animation; focus gained by pointer or touch SHALL NOT show it. |
CHK-7 | WHERE the visual size is below the minimum target THE checkbox SHALL extend its hit area on both axes to sys.target.touch for touch input and sys.target.pointer for fine pointers, without changing its visual size; a platform that cannot tell the input type SHALL use sys.target.touch. The visible label SHALL be part of the hit area as well. |
CHK-8 | WHILE disabled is true THE checkbox SHALL render its container, box, mark, outline, label and opacity from the disabled component tokens of its condition. |
CHK-9 | WHEN the checkbox is pressed by pointer, touch or Space, or by Enter where Enter activates it (Android, tvOS; never on the web, where Enter submits the form) THE checkbox 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. |
CHK-10 | WHILE pressed THE checkbox 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; a press outside the container (on the label) grows it from the container's center); 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; box, mark, outline, label, opacity and shape still come from the pressed tokens. Under none every part stays with the state under the press. The ripple grows over comp.checkbox.motion.feedback-duration with motion.state-easing, fades over motion.state-duration with motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced. |
CHK-11 | THE checkbox SHALL ease its container and 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 its 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. |
CHK-12 | THE checkbox SHALL draw a box of side comp.checkbox.box.size with corners comp.checkbox.box.shape, centered in a round container of diameter comp.checkbox.container.size; its outline of width comp.checkbox.outline.width SHALL lie inside the box's edge and its fill inside the outline, never under it. Its mark SHALL be a glyph of the system's icon set, check while selected and remove while indeterminate, and SHALL NOT be drawn while unselected: centered on the box at comp.checkbox.mark.size, with sys.icon.family.selected, sys.icon.fill.selected, the weight comp.checkbox.mark.weight (not sys.icon.weight) and an optical size clamped between sys.icon.optical-size.min and sys.icon.optical-size.max, not clipped by the box, and hidden from assistive technology. THE checkbox SHALL draw no mark of its own (no path, shape or character of its own for the check or the dash). The weight SHALL change the stroke of the glyph only: the glyph box stays comp.checkbox.mark.size, and the box, the container and the place of the glyph are the same at every weight. |
CHK-13 | WHEN the condition changes after the checkbox was first drawn THE checkbox SHALL change the box, outline and mark colors over comp.checkbox.motion.selection-duration with comp.checkbox.motion.selection-easing; a glyph that appears SHALL fade in over the same duration and curve while growing about the box's center from comp.checkbox.motion.mark-enter-scale of its size to its full size over comp.checkbox.motion.mark-scale-duration with comp.checkbox.motion.mark-scale-easing, and a glyph that goes SHALL fade out and shrink to comp.checkbox.motion.mark-enter-scale the same way; between checked and indeterminate the check goes and the dash appears at the same time. A change of error alone SHALL only recolor, and the box and container SHALL NOT change size or move. |
CHK-14 | THE checkbox SHALL expose the role checkbox with the state checked, not checked or mixed (mixed while indeterminate is true), and SHALL expose the invalid state while error is true. |
CHK-15 | WHILE label is not empty and labelHidden is false THE checkbox SHALL draw label at the inline end of the container, comp.checkbox.label.gap away, in comp.checkbox.label.typescale, wrapping rather than truncating, the control centered on the label's first line; right-to-left layouts SHALL mirror the order. |
CHK-16 | WHILE labelHidden is true THE checkbox SHALL draw no label and SHALL still expose label as its accessible name; WHILE label is not empty, or a Field that frames it gives it a label, THE checkbox SHALL expose that label as its accessible name, over a name the product gives it on the element (aria-label or aria-labelledby); WHILE label is empty and the product gives the checkbox a name of its own on the element — aria-label, or aria-labelledby naming an element — THE checkbox SHALL expose that name as its accessible name; WHILE label is empty and the product gives it none THE checkbox SHALL still render, and in debug builds report that it has no accessible name. |
CHK-17 | WHERE motion is reduced THE checkbox SHALL draw the new condition whole in the first frame after the change: the box, outline and mark colors of the new condition, the new glyph at its full size and full opacity, and the old glyph gone, with no frame in between; a change that arrives while a selection motion is running SHALL end that motion in the same frame. The change SHALL be neither delayed nor skipped. |
CHK-18 | WHEN the condition changes again before the selection motion of CHK-13 has ended THE checkbox SHALL move from what it draws at that moment to the latest condition, never first jumping to the end of the earlier change, and SHALL end on the latest condition's colors and glyph alone. |
CHK-19 | IF the icon set cannot draw the glyph yet (its font is still loading or failed to load) THE checkbox SHALL draw nothing in the glyph's place, never the glyph's name as text, SHALL still draw the box, its fill and its outline and expose its state, and SHALL show the glyph once the icon set can draw it, without the selection motion. |
CHK-20 | THE checkbox 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 checkbox is shown THE checkbox SHALL draw itself for the new direction at once, without a motion of its own, keeping its selection and its focus. |
CHK-21 | THE checkbox SHALL lay out its label as text of its own direction, isolated from the text around it: each takes the base direction of its first strong character, or the layout direction where it has none, so that a left-to-right word, a number with its sign or unit, a telephone number and an address keep their own order in a right-to-left layout and reorder nothing beside them; THE checkbox SHALL still place the label and align its lines by the layout direction, not by the text's own. |
CHK-22 | THE checkbox SHALL draw the outline and the fill of its box as one shape: every point inside the box's outer edge SHALL be painted by the outline, by the fill, or, along the line where the two meet, by both in shares that add up to the whole, so that nothing behind the box shows between them at any zoom, display density or fractional position, in any frame of the selection motion (CHK-13), and so that a box whose outline and fill have the same color is that one color, evenly, from its edge to its mark; the two SHALL NOT be painted over one another either (CHK-12), so that a translucent outline or fill is nowhere darker than its token. |
CHK-23 | WHILE the checkbox stands in a checkbox group THE checkbox SHALL take its checked from the group's value and from the value the group reads from it (CKG-2), SHALL be disabled WHILE the group is (CKG-6), SHALL have its switching by the person reported by the group's change and by no event of its own that a listener on the group would receive as well (CKG-4), and WHERE the platform has forms SHALL submit nothing of its own, whatever name it carries (CKG-8). WHERE the checkbox stands in no checkbox group it SHALL be as it is anywhere — in a field, in a field group, in a table's row or alone: checked is its own, change is its own, and on the web it submits its own entry under its own name. |
CHK-24 | WHILE readOnly is true and disabled is false THE checkbox SHALL stay focusable and in the focus order; SHALL NOT change checked or indeterminate, and SHALL NOT emit change, on any activation — pointer, touch, Space, Enter where Enter activates it, assistive technology, a click on its label or a click dispatched on the element; SHALL expose the read-only state to assistive technology beside its checked, not checked or mixed state; WHERE the platform has forms SHALL be submitted with its form as it is drawn, and SHALL NOT report a missing value to the form's own validation, because the person cannot give one; and SHALL be drawn from the resting component tokens of its condition — the enabled ones, never the disabled ones — and SHALL show no hovered and no pressed state, under any pressed feedback (no overlay, no ripple, no dim), while keyboard focus still selects the focused state and shows the focus ring (CHK-5, CHK-6). The product may still set checked and indeterminate, which then take the selection motion (CHK-13). WHILE disabled is true as well, disabled wins (CHK-3). |
CHK-25 | 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 checkbox 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 the element that carries its role — an id reference by the elements it names in the host's tree or a tree around it, an error message as part of the description while the checkbox is invalid — except those the checkbox owns (aria-checked, aria-pressed, aria-disabled), which it SHALL move and not expose. 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 checkbox SHALL take it off that element. WHEN the product sets an aria- attribute the checkbox owns THE checkbox SHALL report it in debug builds. |
प्लैटफ़ॉर्म के अनुसार नामों का मिलान
पैरिटी का मतलब एक जैसे API नहीं है। हर प्लैटफ़ॉर्म एक ही कॉन्ट्रैक्ट को अपने तरीक़े से व्यक्त करता है।
| स्पेक | Web | SwiftUI | Jetpack Compose | Flutter | React Native |
|---|---|---|---|---|---|
| कंपोनेंट | tanrei-checkbox | TanreiCheckbox | TanreiCheckbox | TanreiCheckbox | Checkbox |
checked · प्रॉपर्टी | checked | isOn | checked | value | value |
indeterminate · प्रॉपर्टी | indeterminate | isIndeterminate | state | tristate | indeterminate |
error · प्रॉपर्टी | error | isError | isError | isError | error |
disabled · प्रॉपर्टी | disabled | disabled | enabled | onChanged | disabled |
readOnly · प्रॉपर्टी | readOnly | readOnly | readOnly | readOnly | readOnly |
label · प्रॉपर्टी | label | title | label | label | label |
labelHidden · प्रॉपर्टी | labelHidden | labelsHidden | labelHidden | labelHidden | labelHidden |
change · इवेंट | change | isOn | onCheckedChange | onChanged | onValueChange |
| टिप्पणियाँ | Form-associated (ElementInternals): it takes part in a form with name and value (default "on"), resets with it, and honours required as the native checkbox does; those three are web attributes, not spec props. It switches its own checked before firing change (and input), as a native checkbox does. labelHidden is the label-hidden attribute. Inside a tanrei-checkbox-group (found with closest() when it connects) it takes checked from the group, ignores name and required, submits nothing and fires no input or change of its own (CHK-23); a value attribute it does not carry is no value there, not "on". readOnly is the readonly attribute (HTML's name; the native attribute does not apply to a checkbox, so the element cancels the activation itself and writes aria-readonly on its native checkbox). | Toggle idiom: TanreiCheckbox(_ title:, isOn: Binding<Bool>, isIndeterminate: Bool = false); activation writes the binding, which is the change event. isIndeterminate is a value the caller derives from its data (a select-all is derived state), so activation sets isOn to true and the caller's data clears it. disabled follows .disabled(_:); labelsHidden follows .labelsHidden(). | Two overloads, as Compose's own: TanreiCheckbox(checked, onCheckedChange, …) and, for a parent that can be indeterminate, TanreiCheckbox(state: ToggleableState, onClick, …) in the TriStateCheckbox idiom, where the caller computes the next state (CHK-2 says it is On). enabled is the inverse flag; a null onCheckedChange draws a checkbox that only displays. | Flutter idiom: value is bool?; with tristate: true a null value is indeterminate. Unlike Flutter's Material checkbox, which cycles null → false, activation from null calls onChanged(true) (CHK-2). A null onChanged disables it. | Controlled, in React Native's value / onValueChange idiom: the caller sets value from the callback. |
टोकन
| टोकन | किसका एलियास | रिज़ॉल्व किया गया मान (लाइट) |
|---|---|---|
--tanrei-comp-checkbox-box-shape | — | 2px |
--tanrei-comp-checkbox-box-size | — | 18px |
--tanrei-comp-checkbox-container-shape | sys.shape.corner.full | 9999px |
--tanrei-comp-checkbox-container-size | — | 40px |
--tanrei-comp-checkbox-disabled-container-shape | — | 9999px |
--tanrei-comp-checkbox-disabled-opacity | — | 1 |
--tanrei-comp-checkbox-error-indeterminate-box-color | sys.color.error | |
--tanrei-comp-checkbox-error-indeterminate-container-color | — | |
--tanrei-comp-checkbox-error-indeterminate-disabled-box-color | — | |
--tanrei-comp-checkbox-error-indeterminate-disabled-container-color | — | |
--tanrei-comp-checkbox-error-indeterminate-disabled-label-color | — | |
--tanrei-comp-checkbox-error-indeterminate-disabled-mark-color | — | |
--tanrei-comp-checkbox-error-indeterminate-disabled-outline-color | — | |
--tanrei-comp-checkbox-error-indeterminate-disabled-state-layer-color | — | |
--tanrei-comp-checkbox-error-indeterminate-focused-box-color | — | |
--tanrei-comp-checkbox-error-indeterminate-focused-container-color | — | |
--tanrei-comp-checkbox-error-indeterminate-focused-label-color | — | |
--tanrei-comp-checkbox-error-indeterminate-focused-mark-color | — | |
--tanrei-comp-checkbox-error-indeterminate-focused-outline-color | — | |
--tanrei-comp-checkbox-error-indeterminate-focused-state-layer-color | — | |
--tanrei-comp-checkbox-error-indeterminate-hovered-box-color | — | |
--tanrei-comp-checkbox-error-indeterminate-hovered-container-color | — | |
--tanrei-comp-checkbox-error-indeterminate-hovered-label-color | — | |
--tanrei-comp-checkbox-error-indeterminate-hovered-mark-color | — | |
--tanrei-comp-checkbox-error-indeterminate-hovered-outline-color | — | |
--tanrei-comp-checkbox-error-indeterminate-hovered-state-layer-color | — | |
--tanrei-comp-checkbox-error-indeterminate-label-color | sys.color.on-surface | |
--tanrei-comp-checkbox-error-indeterminate-mark-color | sys.color.on-error | |
--tanrei-comp-checkbox-error-indeterminate-outline-color | sys.color.error | |
--tanrei-comp-checkbox-error-indeterminate-pressed-box-color | — | |
--tanrei-comp-checkbox-error-indeterminate-pressed-container-color | — | |
--tanrei-comp-checkbox-error-indeterminate-pressed-label-color | — | |
--tanrei-comp-checkbox-error-indeterminate-pressed-mark-color | — | |
--tanrei-comp-checkbox-error-indeterminate-pressed-outline-color | — | |
--tanrei-comp-checkbox-error-indeterminate-pressed-state-layer-color | — | |
--tanrei-comp-checkbox-error-indeterminate-state-layer-color | comp.checkbox.error-indeterminate.outline.color | |
--tanrei-comp-checkbox-error-selected-box-color | sys.color.error | |
--tanrei-comp-checkbox-error-selected-container-color | — | |
--tanrei-comp-checkbox-error-selected-disabled-box-color | — | |
--tanrei-comp-checkbox-error-selected-disabled-container-color | — | |
--tanrei-comp-checkbox-error-selected-disabled-label-color | — | |
--tanrei-comp-checkbox-error-selected-disabled-mark-color | — | |
--tanrei-comp-checkbox-error-selected-disabled-outline-color | — | |
--tanrei-comp-checkbox-error-selected-disabled-state-layer-color | — | |
--tanrei-comp-checkbox-error-selected-focused-box-color | — | |
--tanrei-comp-checkbox-error-selected-focused-container-color | — | |
--tanrei-comp-checkbox-error-selected-focused-label-color | — | |
--tanrei-comp-checkbox-error-selected-focused-mark-color | — | |
--tanrei-comp-checkbox-error-selected-focused-outline-color | — | |
--tanrei-comp-checkbox-error-selected-focused-state-layer-color | — | |
--tanrei-comp-checkbox-error-selected-hovered-box-color | — | |
--tanrei-comp-checkbox-error-selected-hovered-container-color | — | |
--tanrei-comp-checkbox-error-selected-hovered-label-color | — | |
--tanrei-comp-checkbox-error-selected-hovered-mark-color | — | |
--tanrei-comp-checkbox-error-selected-hovered-outline-color | — | |
--tanrei-comp-checkbox-error-selected-hovered-state-layer-color | — | |
--tanrei-comp-checkbox-error-selected-label-color | sys.color.on-surface | |
--tanrei-comp-checkbox-error-selected-mark-color | sys.color.on-error | |
--tanrei-comp-checkbox-error-selected-outline-color | sys.color.error | |
--tanrei-comp-checkbox-error-selected-pressed-box-color | — | |
--tanrei-comp-checkbox-error-selected-pressed-container-color | — | |
--tanrei-comp-checkbox-error-selected-pressed-label-color | — | |
--tanrei-comp-checkbox-error-selected-pressed-mark-color | — | |
--tanrei-comp-checkbox-error-selected-pressed-outline-color | — | |
--tanrei-comp-checkbox-error-selected-pressed-state-layer-color | — | |
--tanrei-comp-checkbox-error-selected-state-layer-color | comp.checkbox.error-selected.outline.color | |
--tanrei-comp-checkbox-error-unselected-box-color | — | |
--tanrei-comp-checkbox-error-unselected-container-color | — | |
--tanrei-comp-checkbox-error-unselected-disabled-box-color | — | |
--tanrei-comp-checkbox-error-unselected-disabled-container-color | — | |
--tanrei-comp-checkbox-error-unselected-disabled-label-color | — | |
--tanrei-comp-checkbox-error-unselected-disabled-mark-color | — | |
--tanrei-comp-checkbox-error-unselected-disabled-outline-color | — | |
--tanrei-comp-checkbox-error-unselected-disabled-state-layer-color | — | |
--tanrei-comp-checkbox-error-unselected-focused-box-color | — | |
--tanrei-comp-checkbox-error-unselected-focused-container-color | — | |
--tanrei-comp-checkbox-error-unselected-focused-label-color | — | |
--tanrei-comp-checkbox-error-unselected-focused-mark-color | — | |
--tanrei-comp-checkbox-error-unselected-focused-outline-color | — | |
--tanrei-comp-checkbox-error-unselected-focused-state-layer-color | — | |
--tanrei-comp-checkbox-error-unselected-hovered-box-color | — | |
--tanrei-comp-checkbox-error-unselected-hovered-container-color | — | |
--tanrei-comp-checkbox-error-unselected-hovered-label-color | — | |
--tanrei-comp-checkbox-error-unselected-hovered-mark-color | — | |
--tanrei-comp-checkbox-error-unselected-hovered-outline-color | — | |
--tanrei-comp-checkbox-error-unselected-hovered-state-layer-color | — | |
--tanrei-comp-checkbox-error-unselected-label-color | sys.color.on-surface | |
--tanrei-comp-checkbox-error-unselected-mark-color | — | |
--tanrei-comp-checkbox-error-unselected-outline-color | sys.color.error | |
--tanrei-comp-checkbox-error-unselected-pressed-box-color | — | |
--tanrei-comp-checkbox-error-unselected-pressed-container-color | — | |
--tanrei-comp-checkbox-error-unselected-pressed-label-color | — | |
--tanrei-comp-checkbox-error-unselected-pressed-mark-color | — | |
--tanrei-comp-checkbox-error-unselected-pressed-outline-color | — | |
--tanrei-comp-checkbox-error-unselected-pressed-state-layer-color | — | |
--tanrei-comp-checkbox-error-unselected-state-layer-color | comp.checkbox.error-unselected.outline.color | |
--tanrei-comp-checkbox-focused-container-shape | — | 9999px |
--tanrei-comp-checkbox-focused-opacity | — | 1 |
--tanrei-comp-checkbox-hovered-container-shape | — | 9999px |
--tanrei-comp-checkbox-hovered-opacity | — | 1 |
--tanrei-comp-checkbox-indeterminate-box-color | sys.color.primary | |
--tanrei-comp-checkbox-indeterminate-container-color | — | |
--tanrei-comp-checkbox-indeterminate-disabled-box-color | — | |
--tanrei-comp-checkbox-indeterminate-disabled-container-color | — | |
--tanrei-comp-checkbox-indeterminate-disabled-label-color | — | |
--tanrei-comp-checkbox-indeterminate-disabled-mark-color | — | |
--tanrei-comp-checkbox-indeterminate-disabled-outline-color | — | |
--tanrei-comp-checkbox-indeterminate-disabled-state-layer-color | — | |
--tanrei-comp-checkbox-indeterminate-focused-box-color | — | |
--tanrei-comp-checkbox-indeterminate-focused-container-color | — | |
--tanrei-comp-checkbox-indeterminate-focused-label-color | — | |
--tanrei-comp-checkbox-indeterminate-focused-mark-color | — | |
--tanrei-comp-checkbox-indeterminate-focused-outline-color | — | |
--tanrei-comp-checkbox-indeterminate-focused-state-layer-color | — | |
--tanrei-comp-checkbox-indeterminate-hovered-box-color | — | |
--tanrei-comp-checkbox-indeterminate-hovered-container-color | — | |
--tanrei-comp-checkbox-indeterminate-hovered-label-color | — | |
--tanrei-comp-checkbox-indeterminate-hovered-mark-color | — | |
--tanrei-comp-checkbox-indeterminate-hovered-outline-color | — | |
--tanrei-comp-checkbox-indeterminate-hovered-state-layer-color | — | |
--tanrei-comp-checkbox-indeterminate-label-color | sys.color.on-surface | |
--tanrei-comp-checkbox-indeterminate-mark-color | sys.color.on-primary | |
--tanrei-comp-checkbox-indeterminate-outline-color | sys.color.primary | |
--tanrei-comp-checkbox-indeterminate-pressed-box-color | — | |
--tanrei-comp-checkbox-indeterminate-pressed-container-color | — | |
--tanrei-comp-checkbox-indeterminate-pressed-label-color | — | |
--tanrei-comp-checkbox-indeterminate-pressed-mark-color | — | |
--tanrei-comp-checkbox-indeterminate-pressed-outline-color | — | |
--tanrei-comp-checkbox-indeterminate-pressed-state-layer-color | — | |
--tanrei-comp-checkbox-indeterminate-state-layer-color | comp.checkbox.indeterminate.outline.color | |
--tanrei-comp-checkbox-label-gap | sys.space.space50 | 4px |
--tanrei-comp-checkbox-mark-size | sys.icon.small | 20px |
--tanrei-comp-checkbox-mark-weight | sys.icon.mark.weight | 500 |
--tanrei-comp-checkbox-motion-feedback-duration | sys.motion.role.feedback | 450ms |
--tanrei-comp-checkbox-motion-mark-enter-scale | — | 0.5 |
--tanrei-comp-checkbox-motion-mark-scale-duration | sys.motion.role.selection.mark | 250ms |
--tanrei-comp-checkbox-motion-mark-scale-easing | sys.motion.easing.spatial | cubic-bezier(0.2, 0, 0, 1) |
--tanrei-comp-checkbox-motion-selection-duration | sys.motion.role.selection.mark | 250ms |
--tanrei-comp-checkbox-motion-selection-easing | sys.motion.easing.state | cubic-bezier(0.2, 0, 0, 1) |
--tanrei-comp-checkbox-motion-state-duration | sys.motion.role.state.compact | 200ms |
--tanrei-comp-checkbox-motion-state-easing | sys.motion.easing.state | cubic-bezier(0.2, 0, 0, 1) |
--tanrei-comp-checkbox-outline-width | sys.border.thick | 2px |
--tanrei-comp-checkbox-pressed-container-shape | — | 9999px |
--tanrei-comp-checkbox-pressed-opacity | — | 1 |
--tanrei-comp-checkbox-selected-box-color | sys.color.primary | |
--tanrei-comp-checkbox-selected-container-color | — | |
--tanrei-comp-checkbox-selected-disabled-box-color | — | |
--tanrei-comp-checkbox-selected-disabled-container-color | — | |
--tanrei-comp-checkbox-selected-disabled-label-color | — | |
--tanrei-comp-checkbox-selected-disabled-mark-color | — | |
--tanrei-comp-checkbox-selected-disabled-outline-color | — | |
--tanrei-comp-checkbox-selected-disabled-state-layer-color | — | |
--tanrei-comp-checkbox-selected-focused-box-color | — | |
--tanrei-comp-checkbox-selected-focused-container-color | — | |
--tanrei-comp-checkbox-selected-focused-label-color | — | |
--tanrei-comp-checkbox-selected-focused-mark-color | — | |
--tanrei-comp-checkbox-selected-focused-outline-color | — | |
--tanrei-comp-checkbox-selected-focused-state-layer-color | — | |
--tanrei-comp-checkbox-selected-hovered-box-color | — | |
--tanrei-comp-checkbox-selected-hovered-container-color | — | |
--tanrei-comp-checkbox-selected-hovered-label-color | — | |
--tanrei-comp-checkbox-selected-hovered-mark-color | — | |
--tanrei-comp-checkbox-selected-hovered-outline-color | — | |
--tanrei-comp-checkbox-selected-hovered-state-layer-color | — | |
--tanrei-comp-checkbox-selected-label-color | sys.color.on-surface | |
--tanrei-comp-checkbox-selected-mark-color | sys.color.on-primary | |
--tanrei-comp-checkbox-selected-outline-color | sys.color.primary | |
--tanrei-comp-checkbox-selected-pressed-box-color | — | |
--tanrei-comp-checkbox-selected-pressed-container-color | — | |
--tanrei-comp-checkbox-selected-pressed-label-color | — | |
--tanrei-comp-checkbox-selected-pressed-mark-color | — | |
--tanrei-comp-checkbox-selected-pressed-outline-color | — | |
--tanrei-comp-checkbox-selected-pressed-state-layer-color | — | |
--tanrei-comp-checkbox-selected-state-layer-color | comp.checkbox.selected.outline.color | |
--tanrei-comp-checkbox-unselected-box-color | — | |
--tanrei-comp-checkbox-unselected-container-color | — | |
--tanrei-comp-checkbox-unselected-disabled-box-color | — | |
--tanrei-comp-checkbox-unselected-disabled-container-color | — | |
--tanrei-comp-checkbox-unselected-disabled-label-color | — | |
--tanrei-comp-checkbox-unselected-disabled-mark-color | — | |
--tanrei-comp-checkbox-unselected-disabled-outline-color | — | |
--tanrei-comp-checkbox-unselected-disabled-state-layer-color | — | |
--tanrei-comp-checkbox-unselected-focused-box-color | — | |
--tanrei-comp-checkbox-unselected-focused-container-color | — | |
--tanrei-comp-checkbox-unselected-focused-label-color | — | |
--tanrei-comp-checkbox-unselected-focused-mark-color | — | |
--tanrei-comp-checkbox-unselected-focused-outline-color | — | |
--tanrei-comp-checkbox-unselected-focused-state-layer-color | — | |
--tanrei-comp-checkbox-unselected-hovered-box-color | — | |
--tanrei-comp-checkbox-unselected-hovered-container-color | — | |
--tanrei-comp-checkbox-unselected-hovered-label-color | — | |
--tanrei-comp-checkbox-unselected-hovered-mark-color | — | |
--tanrei-comp-checkbox-unselected-hovered-outline-color | — | |
--tanrei-comp-checkbox-unselected-hovered-state-layer-color | — | |
--tanrei-comp-checkbox-unselected-label-color | sys.color.on-surface | |
--tanrei-comp-checkbox-unselected-mark-color | — | |
--tanrei-comp-checkbox-unselected-outline-color | sys.color.outline | |
--tanrei-comp-checkbox-unselected-pressed-box-color | — | |
--tanrei-comp-checkbox-unselected-pressed-container-color | — | |
--tanrei-comp-checkbox-unselected-pressed-label-color | — | |
--tanrei-comp-checkbox-unselected-pressed-mark-color | — | |
--tanrei-comp-checkbox-unselected-pressed-outline-color | — | |
--tanrei-comp-checkbox-unselected-pressed-state-layer-color | — | |
--tanrei-comp-checkbox-unselected-state-layer-color | comp.checkbox.unselected.outline.color | |
--tanrei-comp-checkbox-label-typescale | sys.typescale.body | 400 14px/1.5714 |
फ़िक्स्चर
मानक रेंडरिंग। हर प्लैटफ़ॉर्म हर फ़िक्स्चर का स्नैपशॉट एक ही ID से लेता है, ताकि नतीजों की तुलना की जा सके।
unselected
label: Email me updates selected
checked: true label: Email me updates indeterminate
indeterminate: true label: Select all error-unselected
error: true label: I accept the terms error-selected
checked: true error: true label: I accept the terms error-indeterminate
indeterminate: true error: true label: Select all disabled-unselected
disabled: true label: Email me updates disabled-selected
checked: true disabled: true label: Email me updates disabled-indeterminate
indeterminate: true disabled: true label: Select all label-hidden
checked: true label: Select row labelHidden: true read-only-selected
checked: true readOnly: true label: Send me a receipt इससे जनरेट किया गया: specs/checkbox.spec.json, tokens/comp/checkbox.tokens.json, design/tokens/
चेकबॉक्स उस चुनाव के लिए इस्तेमाल करें जो अपने आप में स्वतंत्र है: ऐसी सूची जिसमें लोग कितने भी विकल्प चुन सकते हैं, चाहें तो एक भी नहीं, या एक अकेला हाँ-या-ना, जैसे शर्तों से सहमति। चुनाव तब लागू होता है जब व्यक्ति पुष्टि करता है, उदाहरण के लिए फ़ॉर्म सबमिट करके या सेव करके। चेकबॉक्स टेबल की पंक्तियाँ या लिस्ट के आइटम भी चुनता है।
अनिश्चित स्टेट उस पैरेंट चेकबॉक्स का है जिसके चाइल्ड आंशिक रूप से चेक किए हुए हैं, जैसे किसी लिस्ट के ऊपर “सभी चुनें”। यह कोई तीसरा जवाब नहीं है जिसे व्यक्ति चुन सके।
केवल पढ़ने वाला चेकबॉक्स ऐसा उत्तर दिखाता है जिसे व्यक्ति पढ़ सकता है पर बदल नहीं सकता, जैसे ऑर्डर भेजने से पहले की समीक्षा का चरण, या ऐसी सेटिंग जिसे कुछ ही लोग बदल सकते हैं। यह फ़ोकस क्रम में बना रहता है, अपनी अवस्था के साथ केवल पढ़ने वाले के रूप में घोषित होता है, और अपने फ़ॉर्म के साथ सबमिट होता है। यह सक्षम चेकबॉक्स जैसा दिखता है, बस होवर और दबाने की प्रतिक्रिया के बिना, ताकि यह अनुपलब्ध चीज़ नहीं बल्कि उत्तर की तरह पढ़ा जाए। जब चुनाव लागू ही न हो तब disabled इस्तेमाल करें, और जब किसी को इस तक पहुँचने की ज़रूरत न हो तब उत्तर को टेक्स्ट के रूप में लिखें।
| कंट्रोल | चुनाव | कब लागू होता है | किसके लिए |
|---|---|---|---|
| चेकबॉक्स | कितने भी स्वतंत्र चुनाव, चाहें तो एक भी नहीं | जब व्यक्ति पुष्टि करता है | फ़ॉर्म के विकल्प, शर्तों से सहमति, पंक्तियाँ चुनना |
| रेडियो बटन | एक छोटे ग्रुप में से ठीक एक, जिसमें सभी विकल्प दिखते हैं | आम तौर पर जब व्यक्ति पुष्टि करता है | एक सवाल का एक जवाब |
| स्विच | एक सेटिंग, चालू या बंद | तुरंत | वे सेटिंग जो बदलते ही लागू हो जाती हैं |
- लेबल को चुनाव के रूप में, सकारात्मक ढंग से लिखें: “मुझे अपडेट ईमेल करें”, न कि “मुझे ईमेल न करें”।
- चेकबॉक्स की सूची को ऊपर-नीचे रखें, हर पंक्ति में एक, ताकि हर लेबल एक ही जगह से शुरू हो।
- अनिश्चित स्टेट चाइल्ड से निकालें। पैरेंट सक्रिय किए जाने पर हर चाइल्ड को चेक करें।
- जब कोई ज़रूरी चेकबॉक्स चेक किए बिना छोड़ दिया जाए, तो
errorसेट करें और फ़ॉर्म के संदेश में बताएँ कि क्यों।
- तुरंत लागू होने वाले बदलाव के लिए चेकबॉक्स इस्तेमाल न करें। स्विच इस्तेमाल करें।
- जिन चुनावों में से एक ही हो सकता है, उनके लिए चेकबॉक्स इस्तेमाल न करें। रेडियो बटन इस्तेमाल करें।
- लेबल के भीतर लिंक या दूसरे कंट्रोल न रखें। लेबल पर क्लिक चेकबॉक्स को टॉगल करता है।
- लेबल को तब तक न छिपाएँ जब तक चेकबॉक्स के आसपास की पंक्ति पहले से न बताती हो कि वह क्या चुनता है।
- रोल
checkbox- लेबलिंग
- label is the accessible name, visible or not (labelHidden). A click on the visible label toggles the checkbox, as a native label does. A checkbox with no label is reported in debug builds.
- न्यूनतम टार्गेट
- दिखने वाला आकार छोटा होने पर भी हिट एरिया न्यूनतम टार्गेट साइज़ को पूरा करता है। minimum 32px · pointer 44px · spacing 8px · touch 48px
कीबोर्ड
| कुंजियाँ | क्रिया |
|---|---|
| Tab | Moves focus to the checkbox. |
| Space | Switches it (an indeterminate checkbox becomes checked); nothing while it is read-only. |
| Enter | Nothing on the web (it submits the form); switches it where the platform activates any focused control with Enter (Android, tvOS). |
टिप्पणियाँ
- The mixed state is announced as such (aria-checked="mixed" on the web, a toggleable state of Indeterminate on Android, a Semantics mixed value in Flutter, accessibilityState checked "mixed" in React Native). SwiftUI has no mixed trait on iOS: the value is announced as "mixed" through accessibilityValue.
- error is exposed as invalid (aria-invalid on the web, the error semantics on Android and Flutter). The reason is text the form shows and associates with the checkbox; the checkbox does not draw it.
- Read-only (CHK-24) is a checkbox that shows an answer in place and keeps it in the focus order, so that it is read with its form — on a review step, or where only some people may change it. HTML's readonly attribute does not apply to a checkbox, so a read-only checkbox is not a native one's: on the web it keeps the native checkbox enabled, cancels its activation and says read-only with aria-readonly, which WAI-ARIA allows on the checkbox role; React Aria's isReadOnly is the same: focusable, announced with its value, not changeable. Where the answer needs no control at all, write it as text; where the person may not reach it at all, it is disabled.
- Several checkboxes that answer one question are a checkbox group: it names the set, holds the list of the checked values under one name and says the set's error (CHK-23). A checkbox stands alone where it is one choice of its own — a consent, a setting — and in a field group where each checkbox of a set has a name of its own.
- The check and the dash are decorative glyphs of the icon set, hidden from assistive technology: where a glyph is written as a ligature (the web), its name ("check", "remove") is never announced or shown as text (CHK-12, CHK-19). Checked and indeterminate differ by the glyph alone, and both are exposed as states (CHK-14).
- The mark is drawn at its own weight (comp.checkbox.mark.weight, CHK-12), heavier than the system's icons in the default system. Its color already has the contrast of content on its fill; what a light weight loses is the stroke, which at this size is about one pixel wide and is drawn in a mix of the mark's color and the fill's. A system that sets a lighter weight should look at the dash in particular: it is one stroke, and it is all that tells indeterminate from checked.
- The selection motion is decoration too: under reduced motion the new condition is drawn whole at once, never later (CHK-17).
- The label wraps at 200% text size; the box does not grow with text, because it is a control, not text.
- 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/checkbox.spec.json, tokens/sys/measure.tokens.json
- यह चेकबॉक्स का रोल, अपने स्टेट (चेक किया हुआ, चेक नहीं किया हुआ, या अनिश्चित रहने पर मिला-जुला), अपने अक्षम स्टेट, और
errorसेट रहने पर अमान्य स्टेट के साथ देता है। React Native में अमान्य स्टेट नहीं है, इसलिए वहाँ त्रुटि बनाई जाती है पर पढ़कर नहीं सुनाई जाती। - लेबल ही एक्सेसिबल नाम है, चाहे वह दिखाया गया हो या
labelHiddenसे छिपाया गया हो। दिखने वाला टेक्स्ट सहायक तकनीक से छिपा रहता है, इसलिए नाम एक ही बार पढ़ा जाता है। - लेबल पर क्लिक या टैप चेकबॉक्स को टॉगल करता है। लेबल हिट एरिया का हिस्सा है, और हिट एरिया न्यूनतम टार्गेट पूरा करता है।
- Space इसे टॉगल करती है। Enter इसे सिर्फ़ वहाँ टॉगल करती है जहाँ प्लैटफ़ॉर्म फ़ोकस वाले किसी भी कंट्रोल को Enter से सक्रिय करता है (Android, tvOS); वेब पर Enter फ़ॉर्म सबमिट करती है।
readOnlyसेट रहने पर यह फ़ोकस हो सकता है और अपनी अवस्था के साथ केवल पढ़ने वाले के रूप में घोषित होता है। दबाना, Space, लेबल पर क्लिक याclick()इसे नहीं बदलते, और इस पर होवर या दबाने की कोई प्रतिक्रिया नहीं दिखती। वेब पर इसका मान फिर भी सबमिट होता है, और ज़रूरी होने पर भी यह छूटा हुआ मान रिपोर्ट नहीं करता। HTML काreadonlyचेकबॉक्स पर लागू नहीं होता, इसलिए कंपोनेंट यह ख़ुद करता है।- यह फ़ोकस इंडिकेटर बॉक्स के चारों ओर दिखाता है, सिर्फ़ कीबोर्ड फ़ोकस के लिए।
- चेक और डैश सहायक तकनीक से छिपे रहते हैं। चेक किया हुआ और मिला-जुला स्टेट से पढ़कर सुनाए जाते हैं, ग्लिफ़ के नाम से कभी नहीं।
- जहाँ मोशन कम किया गया है, वहाँ नई अवस्था बदलाव के बाद के पहले फ़्रेम में पूरी बना दी जाती है, कभी देर से या आधी-अधूरी नहीं। किसी बदलाव के दौरान हुआ बदलाव वहीं से आगे चलता है जो उस पल बना हुआ है।
- जब तक आइकन फ़ॉन्ट ग्लिफ़ नहीं बना सकता, चेकबॉक्स उसकी जगह कुछ नहीं बनाता, “check” शब्द तो कभी नहीं, और तब भी अपना भरा हुआ बॉक्स बनाता है और अपना स्टेट देता है। फ़ॉन्ट लोड होते ही ग्लिफ़ दिखने लगता है।
- वेब पर यह नेटिव चेकबॉक्स की तरह फ़ॉर्म में हिस्सा लेता है:
name,value,requiredऔर रीसेट। - लेबल का न होना डीबग बिल्ड में रिपोर्ट किया जाता है।
प्लैटफ़ॉर्म की ज्ञात कमियाँ:
- SwiftUI, Compose, Flutter और React Native अब भी चेक और डैश को अपने ही निशानों के रूप में बनाते हैं और अपने तरीक़े से ऐनिमेट करते हैं, निशान के अपने वेट और एक-शेप वाले बॉक्स के बिना।
readOnlyअभी सिर्फ़ वेब पर है: SwiftUI, Compose, Flutter और React Native में यह अभी नहीं है।m3-likeमें चेक आइकन सेट का ग्लिफ़ है और बढ़ते हुए फ़ेड होकर आता है, जबकि Material अपना चेक एक-एक स्ट्रोक करके बनाता है और उसे मोड़कर डैश बना देता है (मिमिक्री गैपcheckbox-mark-drawn-on)।
- आइकन फ़ॉन्ट लोड करें। जब तक वह लोड नहीं होता, चेक किया हुआ और अनिश्चित चेकबॉक्स एक जैसे दिखते हैं: दोनों बिना ग्लिफ़ के भरे हुए बॉक्स हैं। उनके स्टेट तब भी पढ़कर सुनाए जाते हैं।
- अगर आपका डिज़ाइन सिस्टम निशान के लिए हल्का वेट सेट करता है (
comp.checkbox.mark.weight), तो डैश को देखें: वह एक अकेला स्ट्रोक है, और देखकर अनिश्चित को चेक किए हुए से अलग बताने वाली चीज़ सिर्फ़ वही है। - ऐसा लेबल लिखें जो चुनाव का नाम बताए, और चेकबॉक्स चेक हो या न हो, उसे वही रखें। स्टेट प्लैटफ़ॉर्म पढ़कर सुनाता है।
- जब
errorसेट हो, तो कारण को चेकबॉक्स के बग़ल में या फ़ॉर्म के सारांश में टेक्स्ट के रूप में दिखाएँ, और उसे चेकबॉक्स से जोड़ें। चेकबॉक्स यह बताता है कि वह अमान्य है, यह नहीं कि क्यों। React Native पर संदेश ही त्रुटि के सुनाई देने का अकेला तरीक़ा है। - जो चेकबॉक्स मिलकर एक सवाल का जवाब देते हैं, उनके ग्रुप को एक नाम दें: वेब पर
<legend>वाला<fieldset>।