DocsComponentsTemplatesThemesGitHub

GlassPanel

Translucent material: fill + 22px backdrop blur + 180% saturation + a bright top edge.

Code

import * as React from 'react';
import { GlassPanel } from '@fruit-labs/design';

export default function Demo() {
  return (
    <div
      style={{
        position: 'relative',
        height: 170,
        borderRadius: 22,
        overflow: 'hidden',
        background: 'var(--bg)',
      }}
    >
      <div
        style={{
          position: 'absolute',
          width: 140,
          height: 140,
          borderRadius: '50%',
          background: 'var(--fruit-tangerine)',
          left: 30,
          top: -20,
        }}
      />
      <div
        style={{
          position: 'absolute',
          width: 160,
          height: 160,
          borderRadius: '50%',
          background: 'var(--fruit-grape)',
          left: 200,
          top: 40,
        }}
      />
      <div
        style={{
          position: 'absolute',
          width: 120,
          height: 120,
          borderRadius: '50%',
          background: 'var(--fruit-kiwi)',
          left: 420,
          top: -10,
        }}
      />
      <div
        style={{
          position: 'relative',
          display: 'flex',
          gap: 16,
          padding: 40,
        }}
      >
        <GlassPanel
          style={{
            padding: '18px 24px',
            borderRadius: 24,
            fontWeight: 700,
          }}
        >
          Glass
        </GlassPanel>
        <GlassPanel
          strong
          style={{
            padding: '18px 24px',
            borderRadius: 24,
            fontWeight: 700,
          }}
        >
          Glass strong
        </GlassPanel>
      </div>
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { GlassPanel } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/glass-panel.json

Guidelines

  • Glass floats ABOVE content (bars, menus, floating buttons, palettes). Never use it for body content or cards in the flow.
  • strong for menus, alerts, sidebars; regular for tab bars and toolbars.
  • Glass needs something behind it to read as glass; on a flat background it simply looks like a surface.

Props

PropTypeRequired
strongbooleanNo
askeyof React.JSX.IntrinsicElementsNo
classNamestringNo
styleReact.CSSPropertiesNo
childrenReact.ReactNodeNo

Edit this example on GitHub