feat(ios): expose UIGlassEffect clear variant via new backgroundGlass prop#665
feat(ios): expose UIGlassEffect clear variant via new backgroundGlass prop#665michelemarri wants to merge 1 commit into
backgroundGlass prop#665Conversation
… prop Adds backgroundGlass?: 'regular' | 'clear' prop to <TrueSheet> so apps can opt into the iOS 26 UIGlassEffectStyleClear variant instead of the default regular glass. The prop is ignored when `backgroundColor` or `backgroundBlur` is set (same precedence as today), and on pre-iOS 26 runtimes. Default 'regular' preserves existing behavior for all current users. Naming mirrors the existing backgroundColor / backgroundBlur props for consistency (per maintainer feedback on lodev09#663). Closes lodev09#663
|
@michelemarri is attempting to deploy a commit to the Dinky Team on Vercel. A member of the Team first needs to authorize it. |
lodev09
left a comment
There was a problem hiding this comment.
Hey @michelemarri, thanks for the PR! Looks good to me.
Have you tried building on android? I think this will break, we need a stub for this on android, I think.
Also if you don't mind updating the CHANGELOG. Thank you!
|
Hey I'm also interested in the feature, so I can take this PR over if the OP won't @lodev09 On Android we're only missing @ReactProp(name = "backgroundGlass")
override fun setBackgroundGlass(view: TrueSheetView, tint: String?) {
// iOS-specific prop - no-op on Android
} |
|
@bigcupcoffee feel free to open up separate PR, looks like @michelemarri is MIA lol.
I'm not sure if this is available on IOS? If it is, we could add separate options prop for this e.g. |
|
It's not an explicit property, just a basic |
Closes #663
Adds a new
backgroundGlass?: 'regular' | 'clear'prop on<TrueSheet>so apps can opt into iOS 26'sUIGlassEffectStyleClearvariant. Naming mirrors the existingbackgroundColor/backgroundBlurprops per your suggestion in the issue thread.API
.regularstyle, with luminosity veil for content legibility)UIGlassEffect(style: .clear, isInteractive: true). High transparency, minimal adaptivity, designed for media-rich backdrops where the app provides its own dimming/blur layerPrecedence
Follows the existing pattern —
backgroundColorwins overbackgroundBlur, which wins overbackgroundGlass. The new prop only kicks in when neither of the other two is set, on iOS 26.1+, andUIDesignRequiresCompatibilityis not opted-in.Scope
src/fabric/TrueSheetViewNativeComponent.ts— Fabric specsrc/TrueSheet.types.ts— public TS types (newBackgroundGlasstype + prop)src/TrueSheet.tsx— destructure + forward to nativesrc/navigation/types.ts— add toTrueSheetNavigationSheetPropsPick listios/TrueSheetViewController.h— new@propertyios/TrueSheetView.mm— wirenewProps.backgroundGlass → _controller.backgroundGlassios/TrueSheetViewController.mm— use it insetupBackground~40 lines added, zero deletions. Fully additive: no behavior change for existing users,
default 'regular'preserves current Liquid Glass appearance.Testing
Deployed in production via
patch-packagein soglia72 (an Italian fantasy-football app for Serie A). ThebackgroundGlass="clear"variant is used on a sheet presented over a custom animated pitch canvas, where the system's regular glass veil was washing out the background. No regressions on existing sheets that don't set the prop.Happy to add docs / changelog entry / example snippet if you'd like — let me know how you prefer to structure additions. Thanks for the library and the quick turnaround on the issue!