refactor(checkbox): unify platform-specific files (use Android impl)#4961
Merged
adrcotfas merged 1 commit intoMay 21, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR unifies Checkbox rendering across platforms by routing <Checkbox /> and the iOS-specific entry points (CheckboxIOS, Checkbox.IOS, and Checkbox.Item mode="ios") through the Android implementation to match the MD3 outlined-control look consistently on iOS and Android.
Changes:
- Updated
Checkboxto always renderCheckboxAndroid(removedPlatform.OS === 'ios'branching). - Replaced the iOS-specific
CheckboxIOSimplementation with an alias/re-export ofCheckboxAndroidto preserve existing imports/types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/Checkbox/CheckboxIOS.tsx | Replaced iOS implementation with a re-export/alias to Android checkbox implementation. |
| src/components/Checkbox/Checkbox.tsx | Removed platform conditional logic; always renders CheckboxAndroid. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f2bcafa to
ab117e4
Compare
|
Hey @fabriziocucci, thank you for your pull request 🤗. The documentation from this branch can be viewed here. |
adrcotfas
requested changes
May 21, 2026
c82720b to
ee67d03
Compare
adrcotfas
requested changes
May 21, 2026
ee67d03 to
f94f88f
Compare
adrcotfas
requested changes
May 21, 2026
f94f88f to
d4eac3d
Compare
Per maintainer feedback on callstack#4955, drop the iOS-specific Checkbox renderer and inline the unified MD3 implementation directly into Checkbox.tsx. The same MaterialCommunityIcon-based control now renders on both platforms. Changes: - Checkbox.tsx: inlines what was the Android implementation; renders the same control on both platforms. Drops the Platform.OS dispatching. - CheckboxAndroid.tsx, CheckboxIOS.tsx: deleted. - Checkbox/index.ts: `Checkbox.Android` and `Checkbox.IOS` are kept as back-compat aliases of `Checkbox` itself, so existing imports keep working with no breaking change. - CheckboxItem.tsx: drops the `mode`-based branching; always renders `<Checkbox />`. The `mode` prop is kept and marked deprecated. - src/index.tsx: `CheckboxAndroidProps` and `CheckboxIOSProps` now alias the unified `Props` from Checkbox.tsx (no breaking change). - docs/docusaurus.config.js: removed entries for the now-deleted CheckboxAndroid and CheckboxIOS files. - Snapshot tests updated: the renderer now uses the unified container (36x36 ripple) and MaterialCommunityIcon glyphs on both platforms. `getSelectionControlIOSColor` in utils.ts is intentionally left in place because RadioButtonIOS still depends on it. A similar unification for RadioButton can follow in a separate PR. As a side benefit, callers using `<Checkbox.IOS uncheckedColor=...>` will now see the prop applied (the old iOS variant silently dropped it), addressing one of the API-parity gaps noted in callstack#4949.
d4eac3d to
efa620a
Compare
adrcotfas
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per adrcotfas's feedback on #4955 and the team decision to push breaking changes in v6, this PR fully unifies the Checkbox platform variants. The same MD3 control renders everywhere. All back-compat scaffolding (platform-specific files, props and type aliases) is removed.
Changes
Checkbox.tsx: now the only implementation. Renders the MD3 control usingcheckbox-marked/checkbox-blank-outline/minus-boxMaterialCommunityIcon glyphs.CheckboxAndroid.tsxandCheckboxIOS.tsx: deleted.Checkbox/index.ts: drops theAndroidandIOSaliases. OnlyCheckboxandCheckbox.Itemare exported.CheckboxItem.tsx: drops themode?: 'android' | 'ios'prop. The component always renders the unifiedCheckbox.utils.ts: renamesgetAndroidSelectionControlColortogetSelectionControlColor(and the internal Android-prefixed helpers). The iOS helpers (getSelectionControlIOSColor,getIOSCheckedColor) are intentionally retained becauseRadioButtonIOSstill depends on them; they can be removed once RadioButton is unified the same way.src/index.tsx: drops theCheckboxAndroidPropsandCheckboxIOSPropstype exports. UseCheckboxProps.docs/docusaurus.config.js: removes the entries for the deletedCheckboxAndroidandCheckboxIOSfiles.RadioButton/RadioButtonAndroid.tsx: updates the import to match the renamedgetSelectionControlColor.example/src/Examples/CheckboxItemExample.tsx: drops themode="android"/mode="ios"examples and the corresponding state. The Material Design / iOS sample items are now redundant.Breaking changes (v6)
Checkbox.Android,Checkbox.IOSremoved.CheckboxItem.modeprop removed.CheckboxAndroidProps,CheckboxIOSPropstype exports removed.Test plan
yarn typescriptcleanyarn lintcleanyarn jest: 736/737 (1 skipped, pre-existing); 159/159 snapshots pass. TwoCheckboxItem.test.tsxcases that exercised the removedmodedispatch are deleted; the leading-control snapshot is updated.Visuals
Captured on iOS Simulator (iPhone 17 Pro) and Android Emulator, light + dark theme.
iOS Simulator
CheckboxIOS)Android Emulator
Android rendering is identical before/after; included to document there is no Android regression.