Surfaces
Glass Panel
A glass container in a panel, card or pill shape.
Preview
Demos ready. Update 0.
The preview runs the React version. On iOS 26 and later, the React Native version uses the system’s own glass. See it on a phone.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-panelAdds 11 files to components/glassyui and installs clsx.
Usage
Usage
import { GlassPanel } from "@/components/glassyui/glass-panel";
export function PanelDemo() {
return (
<GlassPanel variant="card" elevation="raised">
Panel content
</GlassPanel>
);
}React Native usage
import { Text } from 'react-native';
import { GlassPanel } from '@/components/glassyui/glass-panel';
import { useGlassTheme } from '@/components/glassyui/glass-provider';
export default function PanelExample() {
const { colors } = useGlassTheme();
return (
<GlassPanel variant="card" style={{ gap: 4 }}>
<Text style={{ color: colors.foreground, fontSize: 17, fontWeight: '600' }}>Morning run</Text>
<Text style={{ color: colors.mutedForeground }}>5.2 km in 28 minutes</Text>
</GlassPanel>
);
}
It also uses Glass Provider. Install them together:
npx shadcn@4.14.1 add @glassyui-native/glass-panel @glassyui-native/glass-provider && npx expo install --fixExamples
Pill panel
<GlassPanel variant="pill" preset="control">
Syncing
</GlassPanel>API reference
GlassPanel
A GlassSurface with shape, spacing and elevation.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'panel' | 'card' | 'pill' | 'panel' | Shape and spacing. |
elevation | 'base' | 'raised' | 'base' | Shadow and border level. |
preset | 'subtle' | 'standard' | 'prominent' | 'control' | 'showcase' | 'control' for pill, else 'standard' | Material strength, as on GlassSurface. |
lens | boolean | true for control and showcase | Chromium-only rim lens, as on GlassSurface; pills get it by default. |
thickness | number | thickness preference | Glass thickness as a multiple of regular (1). |
refraction | 'none' | 'soft' | 'strong' | 'strong' for showcase, else 'none' | Generated refraction; needs refractionBackground. |
refractionBackground | ReactNode | None | Decorative layer bent inside the panel. |
refractionBackgroundSpace | 'local' | 'viewport' | 'local' | Aligns refractionBackground to the panel or to the viewport. |
refractionDisplacement | number | 72 soft, 112 strong | Bend strength of generated refraction. |
interactive | boolean | false | Brightens the panel slightly on hover. |
Also accepts HTML div attributes.
- Types
GlassPanelProps
The React Native props and exports are in the component’s source.