Skip to content

feat(appbar)!: read parts from context and add Expressive props - #5218

Merged
Doberjohn merged 15 commits into
mainfrom
appbar-improvements
Nov 19, 2026
Merged

Doberjohn merged 15 commits into
mainfrom
appbar-improvements

Conversation

@alpharius-ck

@alpharius-ck alpharius-ck commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Per D7 in #5150, Appbar keeps its compound API in 6.0, built on context, with Expressive features as props. Replaces #5075 (credit @pawelkata); covers Appbar's part of #4989.

  • Parts read dark, theme and mode from context instead of cloneElement, so they work inside wrappers like Tooltip.
  • New mode values medium-flexible / large-flexible, variant / width on Appbar.Action, and isScrolled.
  • Bottom bar still works, deprecated until Toolbar (feat: implement Toolbar component #5043).
  • Flat surface fixes animated style on iOS.

BREAKING CHANGE: children render in the given order (isLeading no longer reorders), Content always has a 12dp title margin, and its mode prop is removed.

Screenshots / Videos

Appbar

Test plan

In the example Appbar screen, cycle all modes, toggle Scrolled and Filled action, and check Tooltip and Menu headers.

Appbar no longer inspects and clones its children. Appbar.BackAction,
Appbar.Content and Appbar.Action read dark, theme and mode from context,
so they work when wrapped in other components such as Tooltip.

Adds Material 3 Expressive support as props on the existing parts:
- mode="medium-flexible" and mode="large-flexible" on Appbar and
  Appbar.Header, which grow with a title that wraps onto a second line
- variant and width on Appbar.Action for filled, tonal and wide actions
- isScrolled on Appbar and Appbar.Header for the on-scroll color

The surface renders in flat mode so an animated style shows on iOS. The
bottom bar keeps working and is deprecated until Toolbar lands.

BREAKING CHANGE: Appbar renders its children in the order they are given
instead of moving Appbar.BackAction and the actions with isLeading to the
front. Appbar.Content always has a 12dp margin before its title, and its
internal mode prop is removed. In the center-aligned mode, only
Appbar.BackAction and actions with isLeading count as leading actions.

Based on the work in #5075 by Paweł Kata.

Co-Authored-By: Paweł Kata <pawel.kata@callstack.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
alpharius-ck and others added 2 commits November 13, 2026 16:28
Appbar no longer inspects and clones its children. Appbar.BackAction,
Appbar.Content and Appbar.Action read dark, theme and mode from context,
so they work when wrapped in other components such as Tooltip.

Adds Material 3 Expressive support as props on the existing parts:
- mode="medium-flexible" and mode="large-flexible" on Appbar and
  Appbar.Header, which grow with a title that wraps onto a second line
- variant and width on Appbar.Action for filled, tonal and wide actions
- isScrolled on Appbar and Appbar.Header for the on-scroll color

The surface renders in flat mode so an animated style shows on iOS. The
bottom bar keeps working and is deprecated until Toolbar lands.

BREAKING CHANGE: Appbar renders its children in the order they are given
instead of moving Appbar.BackAction and the actions with isLeading to the
front. Appbar.Content always has a 12dp margin before its title, and its
internal mode prop is removed. In the center-aligned mode, only
Appbar.BackAction and actions with isLeading count as leading actions.

Based on the work in #5075 by Paweł Kata.

Co-Authored-By: Paweł Kata <pawel.kata@callstack.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-improvements

# Conflicts:
#	src/components/Appbar/utils.ts
@alpharius-ck alpharius-ck self-assigned this Nov 13, 2026
# Conflicts:
#	docs/6.x/docs/guides/migration.md
#	src/components/Appbar/Appbar.tsx
#	src/components/Appbar/AppbarContent.tsx
Comment thread src/components/Appbar/AppbarContent.tsx Resolved
Comment thread src/components/Appbar/Appbar.tsx Resolved
Comment thread src/components/Appbar/AppbarContent.tsx Resolved
Comment thread src/components/Appbar/AppbarAction.tsx Resolved
Comment thread src/components/Appbar/Appbar.tsx Resolved
Comment thread docs/6.x/docs/guides/migration.md Resolved
- Center the title of the center-aligned mode from the measured width of
  the items around it, so actions without isLeading and custom children
  are counted, and no spacer pushes the actions
- Call the onLayout of Appbar.Content and Appbar along with the Appbar's
- Center the controls of every mode at the same height as small
- Replace nested ternaries in Appbar.Action with a lookup
- Say Appbar.Content has to be a direct child, add tests for wrapped
  actions, and document the layout, theme and center-aligned changes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@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 8b87dc1. The verdict and the full list are in the summary comment.

Comment thread src/components/Appbar/AppbarContent.tsx Resolved
Comment thread src/components/Appbar/AppbarAction.tsx Resolved
Comment thread src/components/Appbar/Appbar.tsx Resolved
A filled or tonal Appbar.Action is selected by default, but an explicitly
passed selected was ignored, so a toggle could never show its off state.
Default selected to true instead, document it, and cover both variants.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@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 2a651e8. The verdict and the full list are in the summary comment.

Comment thread src/components/Appbar/utils.ts Resolved
Comment thread src/components/Appbar/AppbarAction.tsx Resolved
Comment thread src/components/Appbar/AppbarContent.tsx Resolved
- isLeading only selects the icon color now, say so in its doc and the
  migration guide
- Say that only Appbar.BackAction, Appbar.Content and Appbar.Action read
  the colors and the theme of the Appbar, and that a Tooltip no longer
  gets its theme
- Test that the Appbar forgets the layout of an Appbar.Content that
  unmounts in the flexible and center-aligned modes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@Doberjohn Doberjohn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Nikolay, most of this held up on Android, iOS and web, and the checks pass on the head and merged with main. Two blockers inline (RTL, and web centering), plus a few smaller notes.

Comment thread src/components/Appbar/Appbar.tsx Resolved
Comment thread src/components/Appbar/Appbar.tsx Resolved
Comment thread src/components/Appbar/AppbarAction.tsx Resolved
Comment thread src/components/Appbar/AppbarAction.tsx Resolved
Comment thread src/components/Appbar/AppbarAction.tsx Resolved
Comment thread docs/6.x/docs/guides/migration.md Resolved
Comment thread src/components/Appbar/Appbar.tsx Resolved

@Doberjohn Doberjohn left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Posted twice by mistake, see the review above.

@apex-sentinel-staging

This comment has been minimized.

- Measure the center-aligned title in RTL with the margins React Native
  swaps, so it settles instead of jumping.
- Set the layout handlers in every mode, as the web only observes
  elements that have onLayout when they mount.
- Merge the theme of a part over the theme of the Appbar.
- Make the wide action 52 wide, as in Material 3.
- Fix the icon offsets in the migration guide, mark the v6 props.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@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 079b70f. The verdict and the full list are in the summary comment.

Comment thread src/components/Appbar/Appbar.tsx Resolved
Pin it with a test: elevated with isScrolled keeps the shadow and uses
the surfaceContainer color, isScrolled alone has no shadow.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of a3d09c8

Since the review of 079b70f: 0 new · 0 still open · 2 no longer raised

No open findings.

Not in the reviewers' prompt (1 file)
  • src/components/__tests__/Appbar/__snapshots__/Appbar.test.tsx.snap: generated or a lockfile, so its lines were left out

2 findings below minor hidden (user_settings.min_severity).

2 new findings away from what changed since 079b70f not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (677ab9f2b2cf).

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

@Doberjohn
Doberjohn merged commit 3d9dee3 into main Nov 19, 2026
14 checks passed
@Doberjohn
Doberjohn deleted the appbar-improvements branch November 19, 2026 19:03
Doberjohn added a commit that referenced this pull request Nov 20, 2026
The 6.x migration guide gets the entries that were missing for the Dialog (#5072), FAB (#5110) and TextInput (#5111) changes.

- Dialog: the Portal sample shows the 5.x form and the prop-based API section says `children` is gone. New sections cover `scrollable` in place of `Dialog.ScrollArea`, a function `icon` for the icon's color and size, plain views in place of `Dialog.Content` and `Dialog.Actions` outside a Dialog, and the layout changes. The actions row style has no replacement, and the guide says so.
- FAB: what `visible={false}` now does, and that tests need `includeHiddenElements` to find a hidden FAB.
- TextInput: a disabled field is always read-only.
- Focus indicator: the Appbar sentence now says the parts read the bar's `theme` from context (#5218) and links to that section.

Two notes for apps written against a 6.0 alpha cover the dialog's top spacing and the single dim of a disabled field; neither changes anything for 5.x users.

Part of #4991.
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.

3 participants