refactor: remove ToggleButton - #5095
Open
oleksandrzavarzin-callstack wants to merge 1 commit into
Open
Conversation
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.
Motivation
ToggleButtonpredates the Material Design 3 work and has no place in the v6component set. MD3 has no equivalent component, and both of its use cases are
already covered by components we keep:
IconButtonwithselectedSegmentedButtonsIt is removed outright, with no deprecation alias and no runtime warning, per
the v6 rule against deprecations.
What's removed
ToggleButton,ToggleButton.Group,ToggleButton.Row, and theirutilsToggleButtonProps,ToggleButtonGroupPropsandToggleButtonRowPropsdocs/component-docs.config.tsanddocs/src/data/screenshots.ts, which drive 6.x doc generationMigration
Documented in
docs/6.x/docs/guides/migration.md:Its line in the guide's animated-style list is gone too, since the component no
longer exists to accept a
style.Notes for review
Buttonalso gains aselectedprop as part of its MD3 update. That proparrives with refactor(button): improve MD3 compliance and modernize content API #4928, so if this lands first the sentence describes a prop not
yet on
main. It reads as forward-looking rather than wrong, but it is wortha look if the two land far apart. Every code example in the entry uses only
APIs that exist on
maintoday.Test plan
yarn test,yarn lint,yarn typecheckpass: 54 suites, 669 tests, 1skipped, no obsolete snapshots.
tsc -p example --noEmit).yarn buildindocs/succeeds, and the built output has no 6.xToggleButton page while the archived older-version pages are unchanged.
intentional migration entry and the 5.x docs.
BREAKING CHANGE:
ToggleButton,ToggleButton.GroupandToggleButton.Roware removed, along with
ToggleButtonProps,ToggleButtonGroupPropsandToggleButtonRowProps. UseIconButtonwithselectedfor an icon-onlytoggle, or
SegmentedButtonsfor a set of mutually exclusive options.