Skip to content

spec(Switch): React Native platform record - #12834

Draft
imdreamrunner wants to merge 5 commits into
chore/knowledge-react-native-platform-recordsfrom
spec/switch-react-native-record
Draft

imdreamrunner wants to merge 5 commits into
chore/knowledge-react-native-platform-recordsfrom
spec/switch-react-native-record

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #12592 (react-native records in the knowledge checks); merges after it.

Merge order: the record also cites the open group records spec:AST-126 (#12556, platform controls; its OQ6 is this record's OQ1), spec:AST-124 (#12562, gestures and drag) and spec:AST-130 (#12553, system modules), and the AST-112 amendment (#12563) for FR16 and FR19. It merges after those too.

Exact decision needed

How React Native's Switch implements component:Switch: which props it offers on iOS and on Android, when it is the platform's switch and when it draws core's switch, how the theme reaches it, the row's layout, the drawn thumb's drag, and how screen readers see it.

Existing authority searched

  • component:Switch (docs/specs/components/Switch/Switch.spec.md, current): props, busy and disabled rules, label placement, the thumb's touch behaviour and the switch-pattern accessibility binding; no React Native rendering.
  • spec:AST-082 (current): FR3–FR5 (core and platform contracts; a platform never offers a prop it does not fully honor), FR7 (base props), FR11 (native-first; switches are listed) and DEC-2 (native-only visuals are theme configuration).
  • spec:AST-093 (current) FR2–FR4: the platform's control first; the theme reaches it.
  • spec:AST-126 (open draft): the platform control group; Switch is not one of its six render components, and its OQ6 (which native piece draws the platform's switch) is open, so this record lists it as OQ1.
  • spec:AST-124 (open draft) FR3: drag frames and back-swipe arbitration; spec:AST-130 (open draft) FR6: haptics.
  • spec:AST-085: the disabled-reason rules, including the disabled state exposed with the name and reason.
  • The draft Swift component API, which keeps labelPosition and labelSpacing out of the Apple contracts and makes size macOS-only (the generated iOS SwitchProps still declares size); @astryxdesign/native scopes labelPosition and labelSpacing to Android and Windows.
  • The open React Native records for TopNav (spec(TopNav): React Native platform record #12685) and TabBar (spec(TabBar): React Native platform record #12686), whose shape this record follows. No open pull request adds a Switch React Native record.

Decision

docs/specs/components/Switch/Switch.react-native.spec.md (component:react-native/Switch, platform_of: component:Switch):

  • React Native's Switch keeps web's props and meaning. On iOS the row follows the system's layout, so labelPosition and labelSpacing are in the Android contract only; size is not offered, because the platform's switch has one size; the web's form, Action, DOM-event and CSS props stay on the web (FR1, DEC-1).
  • Switch is the platform's switch, tinted by the theme; it draws core's switch only where the platform's switch is absent (FR2–FR4).
  • At large text sizes the label takes the row and the switch sits under it; a tap anywhere on the row toggles (FR5).
  • The drawn thumb follows a finger, and the drawn track owns its horizontal drags against the content-wide back swipe (FR6, DEC-2). Each change calls onChange once and plays the theme's toggle haptic (FR7).
  • One switch element for screen readers, and a disabled switch with a reason stays reachable and reports its disabled state (AR1–AR4).
  • Each place where the library differs is a gap line under Current-state impact: among them, the library's drawn default, its size and isBackSwipeAllowed props, and a square theme's drawn switch.

Rejected alternatives

None recorded in the record.

Claim scope and non-goals

The record covers only what React Native adds to component:Switch or does differently. The native piece behind the platform's switch, drag arbitration and haptics stay with spec:AST-126, spec:AST-124 and spec:AST-130, which the record's ownership lines name.

Evidence and implementation relationship

The record is a specification only and has no implementation in this pull request. Each requirement was read against the current React Native implementation, and every place where that implementation differs is one of the record's gap lines.

Writing rubric results

  • R1 narration: none; the record is in the present tense and states what the component does.
  • R2 research in the record: none; each decision keeps a short reason.
  • R3 evidence naming a change: none; every basis cell names records and claims.
  • R4 rejected alternatives over one line or outside a decision: none; the record keeps no Rejected: lines.
  • R5 pull request or issue references remaining: none in the record.
  • R6 ruled open questions still listing options: none; OQ1 is unanswered (it is spec:AST-126 OQ6) and keeps its two options.
  • R7 project status (build status or work order): differences from the implementation are stated as FRn gap and ARn gap lines; "not yet released" appears only in the template's lifecycle field and readiness cell.

Scope

Components: Switch (React Native)

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • node scripts/check-knowledge.mjs: knowledge templates and records are aligned; no finding in this record.
  • Prettier: --check clean on the record.
  • git diff --check: clean.

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 19, 2026 8:39am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 19, 2026, 8:45 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This draft record needs an engineering owner's decision before it can be approved: component:react-native/Switch adds requirements (FR1–FR8, AR1–AR4, DEC-1 to DEC-3) that no current spec states yet.

An engineering owner records the decision by commenting /approve-spec <full head SHA>, and as an engineering owner the author may do so. The decision also covers render, named beside core's presentation: 'native', and the boolean isBackSwipeAllowed, which architecture:public-component-api INV2 would express as a <thing>Behavior union. Approval would not clear the findings below, each of which needs a change to the record or, first, an amendment to the current record it contradicts:

  • FR3 and ORD1 draw core's switch where the platform has its own (render="drawn", a theme render.default of drawn, or a square-corner theme), but spec:AST-082 FR11 and spec:AST-093 FR2 allow a custom control only where the platform has none.
  • AR3 says a disabled switch with a reason "is not reported as disabled", which contradicts spec:AST-085 FR5's requirement that the disabled state be exposed together with the name and reason.
  • DEC-3 and FR7 leave size and isBackSwipeAllowed accepted but ignored under render="system", which spec:AST-082 FR3 ("never offers a prop it does not fully honor") and INV3 do not allow.
  • The FR3, FR4 and AR1 basis cells cite spec:AST-126 FR2, FR11 and FR12, which leave Switch out, and "Open questions: None." treats spec:AST-126 OQ6 as settled although it is still open.
Claims and files checked
  • Review mode: full; reason: no-earlier-review
  • Claim: the record is stacked on the knowledge-check change and merges after it. Verified: the base branch is that pull request's head.
  • Claim: the record cites the open control, gesture and system-module drafts and the foundation amendment for FR16, FR19 and FR21. Verified: those claims exist only in those open pull requests.
  • Claim: the descriptions of the current Switch, native-first and disabled-focus records. Verified against those records on main.
  • Claim: the control-group draft's FR2 gap and OQ6 leave Switch's system presentation to React Native's own switch. False: OQ6 is an open design question with two options.
  • Claim: no Swift Switch record exists, and no open pull request adds a React Native Switch record. The Swift part is verified on main; the open pull request part was not enumerated.
  • Claim: the Decision bullets match the record. Verified against FR1, FR3, FR4, FR6–FR8, AR1–AR4 and DEC-1 to DEC-3.
  • Claim: each requirement was read against the current React Native implementation, and each difference is a gap line. Unverified: no React Native implementation is in this repository.
  • Claim: writing rubric results R1–R7. Verified: present tense, no pull request references, "None." under Open questions, and the gap lines name their FR or AR.
  • Claim: the public text has no internal context. Verified.
  • Claim: the knowledge check, Prettier --check and git diff --check pass. Verified at this head.
  • File docs/specs/components/Switch/Switch.react-native.spec.md: the four findings above, plus non-blocking notes on the Governing rules row and system_specs.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This draft record needs an engineering owner's decision before it can be approved: component:react-native/Switch writes FR1–FR7, AV1, ORD1–ORD2, PR1, AR1–AR4, DEC-1 and DEC-2, none of which a current spec states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and as an engineering owner the author may do so. The decision reaches past this record twice: offering no size on either platform takes that prop out of the core contract spec:AST-082 FR3 defines, and naming Material 3's pages as Android's guidelines answers spec:AST-093 OQ1, which FR3 leaves to iOS and macOS. This head fixes all four blocking findings of the previous review — the drawn-rendering default, the disabled-state wording, the ignored size and isBackSwipeAllowed, and the spec:AST-126 basis cells — and leaves one:

  • Miss: FR1 takes labelIcon "with web's names, types, defaults and meaning", but web's labelIcon is ReactNode | IconType, and IconType is a web SVG component React Native cannot draw, so the contract would accept an icon that never appears; spec:AST-082 FR3 forbids a prop a platform does not fully honor and FR4 makes an icon a shared icon name (FR17). Give labelIcon its React Native form in FR1, or list it with the props that stay on the web.
  • Non-blocking: four requirement rows rest on claims that are not in the repository at this head — spec:AST-112 FR16 and FR19, spec:AST-124 FR3 and spec:AST-130 FR6 — so a reader following a basis cell reaches nothing until the open drafts the description names land.
Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the record is stacked on the knowledge-check change and merges after it. Verified: the base branch is that pull request's head, which adds react-native to the platform record languages.
  • Claim: the record also cites the open control, gesture and system-module drafts and the foundation amendment for FR16 and FR19. Verified: those claims exist only in those open pull requests; the foundation record at this head stops at FR15.
  • Claim: the descriptions of the current Switch, native-first, native-guidelines and disabled-focus records. Verified against those records on the default branch.
  • Claim: the Decision bullets match the record. Verified against FR1–FR7, AR1–AR4, DEC-1 and DEC-2.
  • Claim: each requirement was read against the current React Native implementation, and every difference is a gap line. Unverified: no React Native implementation exists in this repository, so the eight gap lines could not be checked.
  • Claim: no Swift Switch record exists, and no open pull request adds a React Native Switch record. Verified: the Switch folder holds only the core record, and a title search of open pull requests returns this one alone.
  • Claim: writing rubric results R1–R7. Verified: present tense, no pull request references in the record, no rejected-alternative lines, OQ1 unanswered with its two options, and each gap line names its FR or AR.
  • Claim: the public text carries no internal context. Verified by scanning both commits' added lines, the title, the body and the branch name.
  • Claim: the knowledge check, Prettier --check and git diff --check pass. Verified at this head.
  • File docs/specs/components/Switch/Switch.react-native.spec.md: the finding above, plus non-blocking notes on the unresolvable basis citations, FR2's undefined "platform turned off in the subtree", and the Swift Switch sentence.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision: this draft record writes requirements that no current record states, and three of them reach beyond the record itself. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or says what to change; the author may do that if they are an engineering owner. What must be settled: whether dropping size on both platforms and scoping labelPosition and labelSpacing to Android is the intended change to Switch's core contract; whether Material 3's pages are Android's guidelines, which the native-guidelines record reserves for a decision before a platform's first native component merges; and whether an app that turns the platform off may draw the custom switch where the system has one, which the native-first rule allows only where the platform has none. One finding needs a change whichever way that decision goes.

  • Miss: "The Swift Switch also takes no labelPosition, labelSpacing or iOS size" (docs/specs/components/Switch/Switch.react-native.spec.md:235, repeated in the description) is not true at this head, because there is no Swift Switch view and the generated iOS SwitchProps declares size (the macOS-only size is intent in the draft Swift component API, which lists the iOS declaration as an open gap), so the sentence offers draft intent as precedent for DEC-1; name the draft contract instead, or drop the sentence, and correct the description.
  • Four requirement bases are not in the repository at this head: FR1 cites spec:AST-112 FR16 and AR1 cites FR19, while that record stops at FR15, and FR6 and FR7 cite spec:AST-124 FR3 and spec:AST-130 FR6, whose records do not exist yet, so landing those pull requests first keeps every basis followable.
Claims and files checked

Review mode: full; reason: spec-record

Claims

  • Stacked on the knowledge-paths pull request and merges after it: verified, the base branch is that pull request's head, which adds the react-native platform language.
  • The record cites four open group records and an amendment, and merges after them: verified, all five are open drafts.
  • Existing authority searched (core Switch; the native-first record's core and platform contracts and native-first rule; the native-guidelines record's platform-control and theme rules; the focusable-disabled record's reason rules): verified against those records.
  • The controls record's Switch is not one of its six render components and its switch question is open: verified at that pull request's head.
  • No open pull request adds a Switch React Native record: verified by a repository search.
  • The Swift Switch takes no labelPosition or labelSpacing and no size on iOS: the label props are verified; the iOS size claim is false, as the finding above states.
  • The record's decision list (props kept and dropped, platform-switch-first rendering, the row at large text sizes, the drawn thumb's drag, one change report and haptic, one accessibility element, the gap lines): verified line by line against the record.
  • Rejected alternatives: none recorded, and the writing-rubric results (no narration, no research, no pull-request references, the open question keeps its options, gaps named by requirement): verified.
  • The record is a specification only with no implementation here: verified, one changed file.
  • Validation: the knowledge check, Prettier --check and git diff --check pass: verified by running all three on the head tree.

Files

  • docs/specs/components/Switch/Switch.react-native.spec.md: one blocking finding (line 235) and two non-blocking notes; the rest of the record reads as the description describes it.

Automated review (maintainer link)


| ID | Candidate invariant | Basis | Draft review state |
| --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------ |
| FR1 | The React Native `Switch` MUST take web's `label`, `value`, `onChange`, `isLoading`, `isLabelHidden`, `description`, `isDisabled`, `disabledMessage`, `isOptional`, `isRequired`, `status`, `labelIcon` and `labelTooltip` with web's names, types, defaults and meaning, and the shared base props on its root (`spec:AST-082` FR7). `onChange` receives the new value. `labelIcon` takes a shared icon name, which the label draws with `Icon`, and not a web SVG component (`spec:AST-082` FR4, FR17). `labelPosition` and `labelSpacing` are in the Android contract and are type errors on iOS. `size` is not offered on iOS or Android (DEC-1). `ref`, `changeAction`, `htmlName`, `onFocus`, `onBlur` and `width` are not offered, and Switch takes no visual prop. | `component:Switch`; `spec:AST-082` FR3–FR5, FR7, DEC-2; `spec:AST-112` FR16; DEC-1 | settled |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: the row opens with "web's names, types, defaults and meaning" and then carves labelIcon out of it, so the lead and the carve-out disagree on types. Dropping "types" from the lead, or scoping it to the props that keep web's type, would make the row read straight. The Builder impact row above still names only two porting exceptions; labelIcon is a third, since web code that passes an SVG icon component changes at the call site.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision: this draft record writes requirements that no current record states, and three of them reach beyond the record itself.

  • size is offered on neither iOS nor Android, and labelPosition and labelSpacing are Android-only (FR1, DEC-1), which changes what spec:AST-082 FR3 calls Switch's core contract.
  • Material 3's Switch, Lists and Accessibility pages are named as Android's guidelines under spec:AST-093 FR3, which covers Apple platforms, while that record's OQ1 keeps Android open.
  • FR2 counts "the platform turned off in the subtree" as an absent platform switch, so an app opt-out draws core's switch where spec:AST-082 FR11 asks for the platform's.

An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or says which requirement to change; the author may do so as an engineering owner. The Swift family line is now accurate, and the remaining notes are non-blocking: FR1's "types" wording and the Builder impact row, two governing citations that rest on core claims the record assigns to the web, and bases that land with the open drafts.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: stacked on the pull request that teaches the knowledge checks React Native records, and merges after it: verified (the base is that pull request's head).
  • Claim: the record cites three open group records and an amendment to the React Native foundation record, which merge first: verified (all four are open drafts, and the cited requirements exist only there).
  • Claim: the core Switch record is current and covers props, busy and disabled rules, label placement, the thumb's touch behaviour and the switch accessibility binding, with no React Native rendering: verified.
  • Claim: the native-first record's contract, base-prop, native-first (switches listed) and visuals-as-theme requirements are current: verified.
  • Claim: the native component guidelines record's platform-control-first and theme requirements are current: verified.
  • Claim: the platform-controls draft leaves Switch out of its six render components and keeps open which native piece draws the switch: verified.
  • Claim: the draft Swift component API keeps the label props off Apple platforms and makes size macOS-only, while the generated iOS props still declare size; the native package scopes the label props to Android and Windows: verified.
  • Claim: open React Native records exist for TopNav and TabBar, and no open pull request adds a Switch one: verified.
  • Claim: the decision bullets (props per platform, the platform's switch with a drawn fallback, the large-text row, the drawn drag against the back swipe, one change report with a haptic, one accessibility element, gap lines for the library's differences) match the record: verified; the record limits the haptic to a tap or drag where the platform's switch plays none.
  • Claim: the record is a specification only, with no implementation here: verified; that each requirement was read against the current React Native library cannot be checked, since that library is not in this repository.
  • Claim: no rejected alternatives are recorded, and the writing rubric holds (present tense, no pull request references, the open question keeps its options, release status only in the lifecycle field and readiness cell): verified.
  • Claim: the knowledge check, Prettier and the whitespace check pass: verified at this head.
  • File: docs/specs/components/Switch/Switch.react-native.spec.md: non-blocking notes at lines 42, 45, 95, 143 and 233; otherwise consistent with the current records it cites.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision: this draft record writes requirements that no current record states, and three of them reach beyond the record itself.

  • size is offered on neither iOS nor Android, and labelPosition and labelSpacing are Android-only (FR1, DEC-1), which changes what spec:AST-082 FR3 calls Switch's core contract.
  • Material 3's Switch, Lists and Accessibility pages are named as Android's guidelines under spec:AST-093 FR3, which covers Apple platforms, while that record's OQ1 keeps Android open.
  • FR2 counts "the platform turned off in the subtree" as an absent platform switch, so an app opt-out draws core's switch where spec:AST-082 FR11 asks for the platform's.

An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or says which requirement to change; the author may do so as an engineering owner. The governing-rules row and AR1's required word now read straight, and AR3's tap reveal follows the web tooltip's rule for a disabled control. The remaining notes are non-blocking: FR1's "types" wording and the Builder impact row, and bases that land with the open drafts.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: stacked on the pull request that teaches the knowledge checks React Native records, and merges after it: verified (the base is that pull request's head).
  • Claim: the record cites three open group records and an amendment to the React Native foundation record, which merge first: verified (all four are open drafts, and the cited requirements exist only there).
  • Claim: the core Switch record is current and covers props, busy and disabled rules, label placement, the thumb's touch behaviour and the switch accessibility binding, with no React Native rendering: verified.
  • Claim: the native-first record's contract, base-prop, native-first (switches listed) and visuals-as-theme requirements are current: verified.
  • Claim: the native component guidelines record's platform-control-first and theme requirements are current: verified.
  • Claim: the platform-controls draft leaves Switch out of its six render components and keeps open which native piece draws the switch: verified.
  • Claim: the disabled-reason record exposes the disabled state with the name and reason: verified.
  • Claim: the draft Swift component API keeps the label props off Apple platforms and makes size macOS-only, while the generated iOS props still declare size; the native package scopes the label props to Android and Windows: verified.
  • Claim: open React Native records exist for TopNav and TabBar, and no open pull request adds a Switch one: verified.
  • Claim: the decision bullets (props per platform, the platform's switch with a drawn fallback, the large-text row, the drawn drag against the back swipe, one change report with a haptic, one accessibility element with a reachable disabled state, gap lines for the library's differences) match the record: verified; the record limits the haptic to changes where the platform's switch plays none.
  • Claim: the record is a specification only, with no implementation here: verified; that each requirement was read against the current React Native library cannot be checked, since that library is not in this repository.
  • Claim: no rejected alternatives are recorded, and the writing rubric holds (present tense, no pull request references, the open question keeps its options, release status only in the lifecycle field and readiness cell): verified.
  • Claim: the knowledge check, Prettier and the whitespace check pass: verified.
  • File: docs/specs/components/Switch/Switch.react-native.spec.md: non-blocking notes at lines 42 and 145, and on the bases that land with the open drafts; otherwise consistent with the current records it cites.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 8a667dc7 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant