Skip to Content
Liquid Glass UI
Components

Button

Responsive Liquid Glass button built to Apple macOS 27 and iOS 27 guidelines, powered by @liqui-design/glass real optical refraction, Base UI, and Motion spring physics.

Built on @liqui-design/glass (true rounded-rect SDF convex lens displacement refraction with a global SVG filter registry supporting Chrome, Safari, and Firefox), @base-ui/react/button, and motion/react, faithfully following the Apple macOS 27 UI Kit and Apple iOS 27 UI Kit.

No platform prop or wrapper is required—the button automatically adapts between desktop and mobile using Tailwind's md: (768px) breakpoint and useIsMobile().

Responsive Live Preview

Toggle Preview / Code at the top of the preview bar to inspect the source, or switch Desktop / Tablet / Mobile on the right to compare macOS 27 and iOS 27 ergonomics. Change the global backdrop at the bottom of the left sidebar:

apple-liquid-ui/preview/button-liquid-hero
MacBook · 16:10

Installation (Shadcn Registry)

# Install via the configured @apple-liquid namespace (automatically installs @liqui-design/glass, motion, and CSS tokens)
npx shadcn@latest add @apple-liquid/button

# Or install directly via URL
npx shadcn@latest add https://your-domain.com/r/button.json

Responsive Spec: macOS 27 vs iOS 27

Uses standard mobile-first Tailwind breakpoints (< 768px defaults to iOS 27; md: and up switches to macOS 27) paired with useIsMobile():

FeaturemacOS 27 (Desktop >= 768px)iOS 27 (Mobile < 768px)
Corner silhouetteFull pill (rounded-full) across all sizes; override via Tailwind className (e.g. rounded-md) when neededFull pill (rounded-full) across all sizes for touch ergonomics
Sizing scaleCompact desktop density (default: 32px / 13.5px, icon: 32px)Apple HIG touch targets (default: 46px / 17px, lg: 50px, icon: 44px)
Optical curvatureBalanced desktop bevel (bezel: 11, refraction: 46)Fuller mobile liquid curvature (bezel: 14, refraction: 56)
Motion springCrisp desktop press (scale: 0.97, stiffness: 520)Bouncy liquid rebound (scale: 0.935, stiffness: 380, damping: 22)

All Visual Variants

variant strictly preserves shadcn/ui's 6 semantic variants (default / secondary / outline / ghost / destructive / link), while the orthogonal glass prop toggles Apple Liquid Glass refraction:

apple-liquid-ui/preview/button-all-variants
MacBook · 16:10

Material is controlled solely by glass: enabled by default (default maps to Glass Prominent, others to Glass); pass glass={false} for the 100% opaque Bordered style (default solid accent, secondary neutral gray, ghost transparent); automatically switches to Over-Glass flat fills on glass surfaces. To merge multiple toolbar buttons into one shared glass capsule, use <ButtonGroup>.

destructive mirrors Apple's soft-red fill with red label: macOS 27 Alert Destructive on desktop (#F52F32 at 23% light / #FF4747 at 25% dark) and iOS 27 Bordered Destructive on mobile (14% red fill); with glass, it renders iOS 27 Glass / Destructive (clear glass + red text).

Size Scale

A single xs / sm / default / lg and icon button scale adapts automatically to each platform's proportions:

apple-liquid-ui/preview/button-sizes
MacBook · 16:10

Over-Glass Surface Adaptation (Apple 27 UI Kit)

Apple never stacks glass on glass: buttons inside Liquid Glass surfaces (Dialog, Popover, Sheet, Drawer, glass Card, Toast, or a custom <OverGlass> container) automatically switch to Sketch's Over-Glass flat fills (Prominent solid accent, Bordered translucent neutral), ignoring glass. Override explicitly with surface="content" | "over-glass" when needed:

apple-liquid-ui/preview/button-over-glass
MacBook · 16:10

Usage

import { Button } from '@/components/ui/button';

export function Example() {
  return (
    <div className="flex items-center gap-3">
      <Button glass>Get Started</Button>
      <Button variant="secondary" glass>Learn More</Button>
      <Button variant="destructive" glass>Delete Project</Button>
      <Button variant="secondary" glass glassProps={{ refraction: 1.4, bezel: 14 }}>
        Stronger Edge Refraction
      </Button>
    </div>
  );
}

Props API

PropTypeDefaultDescription
variant'default' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link''default'Standard shadcn semantic variants
glassbooleantrueLiquid Glass Regular - Small control material (default tinted glass, others clear glass, destructive red label; synced with global tint); false renders 100% opaque Bordered equivalent; auto-switches to Over-Glass on glass surfaces
size'xs' | 'sm' | 'default' | 'lg' | 'icon-xs' | 'icon-sm' | 'icon' | 'icon-lg''default'Responsive size scale (iOS 27 on mobile, macOS 27 on desktop)
surface'content' | 'over-glass'Auto-detectedSurface context; automatically 'over-glass' inside glass surfaces, or pass explicitly to override
glassProps{ refraction?: number; bezel?: number; dispersion?: number }—Optical tuning when glass is active: refraction multiplier, edge bezel width (px), chromatic dispersion (default 0)
disableMotionbooleanfalseDisable Motion press spring animation (respects prefers-reduced-motion)
renderReact.ReactElement—Inherited from @base-ui/react/button for custom elements (e.g. Next.js <Link />)

On this page