feat: refactor icon button component - #5103
Open
alpharius-ck wants to merge 2 commits into
Open
Conversation
# Conflicts: # src/components/IconButton/IconButton.tsx # src/components/IconButton/utils.ts # src/components/TextInput/TextInputIcon.tsx
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
IconButton in v6 still used the older Material 3 API: a numeric size, contained / contained-tonal modes, and a single selected-color path. That does not match the current M3 Expressive icon button spec (or the androidx 14.1.0 tokens), and it is out of step with components that were already modernized (TextInput, Switch, Checkbox, FAB).
This change brings IconButton onto that spec: the XS–XL size scale, narrow / default / wide widths, round and square shapes with press and toggle morph, standard / filled / tonal / outlined color styles (including a distinct toggle-OFF set), and disabled filled/tonal container opacity of 0.10. Tokens live with the component and reuse the theme shape, color, and motion systems so the example app and generated docs stay aligned.
Related issue
https://app.notion.com/p/callstack/Modernize-IconButton-to-Material-3-Expressive-3ac5d027c0f880fcb083e5a909d4d82b?source=copy_link
Test plan