Skip to main content
Svelte 5 library · On npm

GlassLikeUI

Frosted glass for Svelte 5, in the style of Apple's Liquid Glass from iOS 26. Everything on this page is the real thing.

Inspired by Apple's design. It's my own library, not made by or affiliated with Apple.

Two props

Six looks from two props

variant picks regular or clear. intensity sets blur, edge displacement and saturation together, from subtle to prominent.

SubtleStandardProminent
Regular
Clear
Shapes

Rect, capsule, circle

shape works like SwiftUI's glassEffect(_:in:).

Rect
Capsule
Circle
Buttons

Seven button styles

Try them

Tap, drag, swipe

Toggle

An iOS-style switch built on a native checkbox.

Sheet

A bottom sheet with detents and drag to snap.

Swipe actions

Swipe this row

Swipe a row aside to reveal its actions, like SwiftUI's .swipeActions.

Accessibility

It follows your settings

No setup needed. GlassLikeUI reads your system preferences and changes how the glass looks.

Reduce transparency
Surfaces go opaque and the blur turns off.
Increase contrast
Thicker borders and higher opacity.
Reduce motion
Transitions and motion highlights turn off.

Browsers that don't report these settings get data attributes you can set yourself, and syncAccessibilityPreferences() can manage them for you.

Scope

Only what iOS has

GlassLikeUI only includes components that mirror the native glass parts in iOS 26: surfaces, sheets, navigation bars, tab bars, buttons, toggles, lists. Page layouts and combinations, like the demos on this page, live in the site, not the library.

This site uses it for the layout, the navigation and every project page.

Install

Two steps

Install it. Svelte 5 is the only peer dependency.

npm install glasslikeui

Mount LensFilters once near the root of your app and import the stylesheets you want.

<script>
  import { LensFilters } from 'glasslikeui';
  import 'glasslikeui/glasslikeui.css';
  import 'glasslikeui/lens.css';
  import 'glasslikeui/squircle.css';
  import 'glasslikeui/typography.css';
</script>

<LensFilters />
<!-- rest of app -->

Then use it

<script>
  import { Glass, Button } from 'glasslikeui';
</script>

<Glass variant="regular" intensity="standard">
  {#snippet children()}
    <h2>Frosted card</h2>
    <Button variant="filled">Action</Button>
  {/snippet}
</Glass>
Browsers

Where it works

Chrome and Edge 111+
Full effect
Safari 16.4+
Full effect
Firefox 115+
Full effect (103 to 114 without edge lensing)
Older browsers
An opaque fallback

Safe to render on the server.

  • Svelte 5
  • TypeScript
  • CSS custom properties
  • View Transitions
  • SVG filters
  • Light and dark themes
  • npm
  • GPL-3.0-or-later
Back to home