@@ -31,18 +31,17 @@ yarn add @callstack/liquid-glass
3131### Usage
3232
3333``` tsx
34- import { LiquidGlassView } from ' @callstack/liquid-glass' ;
35-
36- // Handle fallback for unsupported iOS versions
37- const supportsLiquidGlass =
38- Platform .OS === ' ios' && Number (Platform .Version .split (' .' ).at (0 )) >= 26 ;
34+ import {
35+ LiquidGlassView ,
36+ isLiquidGlassSupported ,
37+ } from ' @callstack/liquid-glass' ;
3938
4039function MyComponent() {
4140 return (
4241 <LiquidGlassView
4342 style = { [
4443 { width: 200 , height: 100 , borderRadius: 20 },
45- ! supportsLiquidGlass && { backgroundColor: ' rgba(255,255,255,0.5)' },
44+ ! isLiquidGlassSupported && { backgroundColor: ' rgba(255,255,255,0.5)' },
4645 ]}
4746 interactive
4847 effect = " clear"
@@ -56,6 +55,22 @@ function MyComponent() {
5655> [ !NOTE]
5756> On unsupported iOS version (below iOS 26), it will render a normal ` View ` without any effects.
5857
58+ ### API
59+
60+ #### ` isLiquidGlassSupported `
61+
62+ A boolean constant that indicates whether the current device supports the liquid glass effect.
63+
64+ ``` tsx
65+ import { isLiquidGlassSupported } from ' @callstack/liquid-glass' ;
66+
67+ if (isLiquidGlassSupported ) {
68+ // Device supports liquid glass effect
69+ } else {
70+ // Provide fallback UI
71+ }
72+ ```
73+
5974### LiquidGlassView - Props
6075
6176| Prop | Type | Default | Description |
0 commit comments