Skip to content

refactor(chip): MD3 improvements - #5238

Open
kachmashk wants to merge 7 commits into
callstack:mainfrom
kachmashk:refactor/chip-improvements
Open

kachmashk wants to merge 7 commits into
callstack:mainfrom
kachmashk:refactor/chip-improvements

Conversation

@kachmashk

@kachmashk kachmashk commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Breaking API and behavior

  • Changes the default mode from flat to outlined.
  • Removes the compact and showSelectedOverlay props; the selected overlay is now handled automatically for avatars.
  • Reworks selected, outlined, disabled, icon/avatar and close-icon color resolution (getChipColors in utils.ts, renamed from helpers.tsx) to align with MD3 state and color roles, with a dedicated ripple color and avatar selected-overlay color.
  • A focused outlined chip shows the focus outline color instead of selectedColor.
  • Removes the press-time elevation animation in favor of a static elevation derived from the elevated and disabled props.

Accessibility, focus and interaction

  • Replaces the hand-rolled reanimated focus ring with the shared useFocusRing hook, as Button, Card and FAB do.
  • Draws the body ring once, on the Surface, and passes focusRing="none" to both ripples so TouchableRipple no longer adds a second ring.
  • Wraps the trailing/close button in an unclipped view that carries its own ring, so the ripple's circular clipping can't cut it off.
  • Renders a trailing icon without a handler as a decorative view: no button role, label, ripple, hit slop or focus ring.
  • Adds a 48dp minimum touch target via hitSlop, and moves the close icon into TouchableRipple for consistent ripple/state-layer feedback.
  • Removes the trailing icon's left hitSlop so it doesn't overlap the label's touch area.
  • Stops dimming the disabled avatar twice.

More including cleanups, docs, example app and tests.

Motivation

Align the Chip component with Material Design 3 guidelines and specs.

Related issue

refactor(chip): improve selection model and MD3 compliance #4931
feat: implement Chip component #5081

Screenshots / Videos

chips-merged

Test plan

Run the example app (ChipExample) on iOS, Android and web, in light and dark themes, and click through every chip. Then turn on VoiceOver (iOS) or TalkBack (Android) and swipe through them.

  • Looks: outlined by default, flat, elevated, selected (check icon, or check over an avatar) and disabled chips match MD3 in both themes.
  • Press: the body and the close or trailing button each ripple and fire only their own handler, including taps just above, below and right of the trailing button. A trailing icon without a handler does nothing.
  • Keyboard (web, Android): Tab shows exactly one ring per control, on the chip body and separately on the trailing button. Disabled chips and chips with no handler are skipped.
  • Screen reader: the chip is announced as a button with its selected and disabled state, and the close and trailing buttons use their labels. A trailing icon without a handler is not announced as a button.
  • Docs: the migration guide matches this behavior.

@kachmashk kachmashk self-assigned this Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Found potential problems with the pull request:

  • The description is too long. Please keep it under 1000 characters.

@kachmashk
kachmashk marked this pull request as ready for review November 19, 2026 15:00
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 9 new findings on ac535b2. The verdict and the full list are in the summary comment.

Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
Comment thread src/components/Chip/Chip.tsx Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 520457a. The verdict and the full list are in the summary comment.

Comment thread src/components/Chip/Chip.tsx Resolved
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 7d89689

Since the review of 520457a: 0 new · 0 still open · 1 no longer raised (1 marked fixed)

No open findings.

Not in the reviewers' prompt (5 files)
  • docs/public/gallery/chip-dark.png: no text diff (a binary, empty or mode-only change)
  • docs/public/gallery/chip.png: no text diff (a binary, empty or mode-only change)
  • docs/public/screenshots/chip.png: no text diff (a binary, empty or mode-only change)
  • src/components/__tests__/__snapshots__/Chip.test.tsx.snap: generated or a lockfile, so its lines were left out
  • src/components/__tests__/__snapshots__/ListItem.test.tsx.snap: generated or a lockfile, so its lines were left out

3 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (295f36b5e27b).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant