Skip to content

feat!: modernize List-related components to the latest MD3 specs - #5224

Open
jacekAtCK wants to merge 26 commits into
callstack:mainfrom
jacekAtCK:feat/modernize-list-md3
Open

jacekAtCK wants to merge 26 commits into
callstack:mainfrom
jacekAtCK:feat/modernize-list-md3

Conversation

@jacekAtCK

@jacekAtCK jacekAtCK commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Takes over #5143. Brings List.Item and List.Accordion in line with the MD3 list spec: tokens, spacing and typography, selected state, animated accordion, and leading and trailing slots on List.Item. left and right on List.Item are deprecated.

Related issue

Closes #4976
Part of #4930

Screenshots / Videos

List.Accordion on Android
list-accordion.mp4

Test plan

In the List example:

  1. Compare rows against the spec.
  2. Expand and collapse an accordion. Rows below move with it.
  3. A selected row uses the secondary container colors.

@Doberjohn Doberjohn assigned Doberjohn and jacekAtCK and unassigned Doberjohn Nov 16, 2026
@Doberjohn Doberjohn added this to the 6.0.0-beta.0 milestone Nov 16, 2026
@jacekAtCK jacekAtCK changed the title feat: modernize List-related components to the latest MD3 specs feat!: modernize List-related components to the latest MD3 specs Nov 16, 2026
@Doberjohn
Doberjohn self-requested a review November 17, 2026 18:52
@Doberjohn

Copy link
Copy Markdown
Collaborator

/review

@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: 3 new findings on cd9dfe1. The verdict and the full list are in the summary comment.

Comment thread src/components/List/ListAccordion.tsx Resolved
Comment thread src/components/List/ListAccordion.tsx Resolved
Comment thread src/components/List/ListItem.tsx Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@jacekAtCK
jacekAtCK requested a review from Doberjohn November 19, 2026 12:43
@jacekAtCK

Copy link
Copy Markdown
Collaborator Author

Four things block the merge:

1. **Migration guide.** As a breaking PR, it needs before and after entries under `### List` in `docs/6.x/docs/guides/migration.md`:
   
   * `List.Accordion`: the title and icon no longer turn `primary` when expanded, the header is `surface` instead of `background`, the chevron rotates instead of switching to `chevron-up`, and the content animates and stays mounted until the collapse ends.
   * `List.Item` and `List.Accordion`: `bodyLarge` and `bodyMedium` typography instead of `fontSize` 16 and 14, MD3 heights (56, 72 and 88dp) and a 16dp trailing inset instead of 24dp.
   * `List.Image` with `variant="video"`: a new vertical margin.
   
   For the squash I'd use: `BREAKING CHANGE: List.Item and List.Accordion now use the MD3 list sizes, spacing and theme typography, and List.Accordion keeps its colors when expanded and animates its content.`

2. **Selected colors.** The spec tokens give `#E8DEF8` and `#4A4458` for the selected state, which are `secondaryContainer` and `onSecondaryContainer`, not the primary pair. Could `tokens.ts` use those? Better settled before 6.0.

3. **Button role.** A pressable `List.Item` has no role, so screen readers don't announce it as a button. Could you set it before `{...rest}`, and move `aria-selected` there too? That also fixes the open thread about it being overwritten.
   focusRing="inward"
   role={onPress ? 'button' : undefined}
   aria-selected={selected}
   {...rest}
   The full test suite passes with this, with no snapshot changes.

4. **Deprecate `left` and `right` on `List.Item`.** On the question from [feat: modernize List-related components to the latest MD3 specs #5143](https://github.com/callstack/react-native-paper/pull/5143): we'll keep both in 6.x and remove `left` and `right` in 7.0. Could you mark them `@deprecated` in the JSDoc, pointing to `leading` and `trailing` (no runtime warning), switch the usage examples in `ListItem.tsx` and `ListSection.tsx` to the slots, and add a line to the migration guide? `List.Accordion` keeps `left` and `right` for now.

all four are fixed now.

@jacekAtCK

Copy link
Copy Markdown
Collaborator Author

/review

@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 6e1aa5f. The verdict and the full list are in the summary comment.

Comment thread docs/6.x/docs/guides/migration.md Resolved
@apex-sentinel-staging

This comment has been minimized.

Comment thread src/components/List/ListItem.tsx Resolved
Comment thread src/components/List/utils.ts Resolved
Comment thread src/components/List/ListAccordion.tsx Resolved
Comment thread src/components/List/ListItem.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 70280c9. The verdict and the full list are in the summary comment.

Comment thread src/components/List/ListItem.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 f68bc28. The verdict and the full list are in the summary comment.

Comment thread src/components/List/utils.ts Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 9c749a2

Since the review of 7cb7645: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' scope (4 files)
  • src/components/__tests__/__snapshots__/ListAccordion.test.tsx.snap: generated or a lockfile, so its lines were left out
  • src/components/__tests__/__snapshots__/ListImage.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
  • src/components/__tests__/__snapshots__/ListSection.test.tsx.snap: generated or a lockfile, so its lines were left out

Reviewed with this repository's own Sentinel configuration (63a3d5acf854).

💬 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.

feat: modernize List related components to the latest MD3 specs

6 participants