Skip to content

feat: Add backdrop-filter support for Android - #59141

Open
marcinszalski-callstack wants to merge 1 commit into
react:mainfrom
marcinszalski-callstack:feat/css_backdrop_filter_android
Open

marcinszalski-callstack wants to merge 1 commit into
react:mainfrom
marcinszalski-callstack:feat/css_backdrop_filter_android

Conversation

@marcinszalski-callstack

@marcinszalski-callstack marcinszalski-callstack commented Oct 16, 2026 •

Copy link
Copy Markdown

Summary:

This PR adds JS support for the backdrop-filter style property. It follows the CSS Filters spec as applied to backdrop rendering. The property accepts the same FilterFunction type already used by the filter property, so no new types are introduced — the existing array and string parsing via processFilter is reused directly.

Supported filter functions: blur, brightness, contrast, grayscale, sepia, saturate, invert, hue-rotate, drop-shadow.

Note: opacity() and drop-shadow() are parsed and accepted without error, but are effectively no-ops in a backdrop-filter context — opacity() reveals the unfiltered content beneath, and drop-shadow() operates on the rectangular backdrop image rather than content-shaped output, producing no visible result. This matches expected CSS spec behavior.

Work has been split into three PRs for more convenient reviewing. This part adds Android support.

Changelog:

[ANDROID] [ADDED] - Add backdrop-filter CSS support for Android

Test Plan:

Merge the JS and iOS PRs and run the RNTester app.

  • Test the Backdrop Filter screen in RNTester (BackdropFilterExample.js)
bf_merged2

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 16, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 16, 2026
@kagantemizkan

kagantemizkan commented Nov 21, 2026 •

Copy link
Copy Markdown

Hi @marcinszalski-callstack, thanks for this. We tried the Android + JS PRs (#59141 + #59138) together in RNTester on an Android 17 QPR emulator (SDK 37.2) and ran into two things that also affect the snapshot path:

  1. A view whose only visual prop is backdropFilter is flattened away. ViewShadowNode doesn't treat backdropFilter as forming a view (it does for filter), so e.g. <View style={{borderRadius: 30, backdropFilter: 'blur(10px)'}}> with children never gets a native view and nothing is filtered. One line in ViewShadowNode.cpp fixes it (!viewProps.backdropFilter.empty() ||). This probably matters for feat: Add backdrop-filter support for iOS #59140 (iOS) too.
  2. The filter only works when the direct native parent is a ReactViewGroup. When layout-only ancestors are flattened, the filtered view can end up directly under ReactSurfaceView, and drawChild never runs for it.

We also built a native path on top of this PR for SDK 37.2+, where RenderNode.setBackdropRenderEffect exists:

  • no bitmap; the backdrop includes content outside the parent (e.g. a sibling ScrollView scrolling behind the view),
  • the view draws its effect node in its own draw(), so it follows native-driver transform/opacity animations and works under any parent,
  • clipped to the border radius without clipping overflow: visible children.

Below 37.2 your snapshot path is unchanged. The method is resolved by reflection since compileSdk is 37.0.

Branch: https://github.com/kagantemizkan/react-native/tree/native-backdrop-37-2 (one commit on top of yours: kagantemizkan@cc5d61b)

Happy to open it as a PR against your branch, or as a follow-up once this lands, whichever you prefer.

Screenshots (SDK 37.2 emulator, native path):

borderRadius: 30 (left: no filter, right: blur(10px))

rounded

blur(2px), blur(4px), blur(8px) with borderRadius: 40

small-blur-rounded

borderRadius + child overflowing with overflow: visible: backdrop clipped, child not

rounded-overflow

opacity: 0.5 / backgroundColor: rgba(255,255,255,0.4) on top

opacity-and-tint

View over a sibling ScrollView, before and after scrolling (snapshot path: no blur here)

scroll-behind

Animated translate + scale with the native driver, 0.7 s apart (snapshot path: stays in place)

native-driver

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants