Glass Banner
A soft blue glass panel for a page's opening moment. A title and caption sit on bubble art, and a few glass chips show what happens next. Drag a chip and let go: it stretches with its speed and springs home.
Installation
pnpm dlx shadcn@latest add https://sprout.tulipfarm.ai/r/glass-banner.jsonCopies Glass Banner into your app, installs the packages, and adds the styles. Then import it from @/components/ui/glass-banner. Needs Tailwind CSS 4 and a components.json from shadcn init.
Install the following dependencies:
pnpm add clsx tailwind-mergeAdd Sprout base once per app: the
cn()helper and the design tokens.lib/sprout/classes.ts- Design tokens, for your global CSS
Copy and paste the following code into your project.
import { useEffect, useId, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from 'react'; import { cn } from '@/lib/sprout/classes'; export interface GlassBannerProps extends Omit<ComponentProps<'div'>, 'title' | 'children'> { title: ReactNode; caption?: ReactNode; children: ReactNode; } export function GlassBanner({ title, caption, className, children, ...props }: GlassBannerProps) { const id = useId(); const titleId = `${id}-title`; const captionId = `${id}-caption`; const hasCaption = caption !== undefined && caption !== null && caption !== false && caption !== ''; return ( <div data-slot="glass-banner" {...props} className={cn('sprout-glass-banner', className)}> <div data-slot="glass-banner-art" className="sprout-glass-banner-art" aria-hidden="true"> {Array.from({ length: 5 }, (_, index) => ( <span key={index} data-slot="glass-bubble" className="sprout-glass-bubble" /> ))} </div> <div data-slot="glass-banner-copy" className="sprout-glass-banner-copy"> <p id={titleId} data-slot="glass-banner-title" className="sprout-glass-banner-title"> {title} </p> {hasCaption && ( <p id={captionId} data-slot="glass-banner-caption" className="sprout-glass-banner-caption"> {caption} </p> )} </div> <ul data-slot="glass-banner-chips" className="sprout-glass-banner-chips" aria-labelledby={hasCaption ? captionId : titleId} > {children} </ul> </div> ); } export interface GlassChipProps extends Omit<ComponentProps<'li'>, 'children'> { icon?: ReactNode; children: ReactNode; } const clamp = (value: number, limit: number) => Math.max(-limit, Math.min(limit, value)); const prefersReducedMotion = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches; export function GlassChip({ icon, className, children, ref, ...props }: GlassChipProps) { const chip = useRef<HTMLLIElement>(null); useImperativeHandle(ref, () => chip.current!, []); useEffect(() => { const element = chip.current; if (!element) return; let x = 0, y = 0, vx = 0, vy = 0, targetX = 0, targetY = 0; let startX = 0, startY = 0, pointer: number | null = null, frame = 0; const paint = () => { const speed = Math.hypot(vx, vy); const stretch = Math.min(speed / 70, 0.22); const angle = Math.atan2(vy, vx); element.style.transform = `translate(${x}px, ${y}px) rotate(${angle}rad) scale(${1 + stretch}, ${1 - stretch * 0.55}) rotate(${-angle}rad) rotate(${clamp(vx * 0.35, 10)}deg) skewX(${clamp(-vx * 0.25, 8)}deg)`; }; const rest = () => { x = y = vx = vy = 0; element.style.transform = ''; element.removeAttribute('data-dragging'); frame = 0; }; const tick = () => { if (pointer !== null) { vx = (targetX - x) * 0.28; vy = (targetY - y) * 0.28; } else { vx = (vx - x * 0.09) * 0.82; vy = (vy - y * 0.09) * 0.82; if (Math.abs(x) + Math.abs(y) + Math.abs(vx) + Math.abs(vy) < 0.05) { rest(); return; } } x += vx; y += vy; paint(); frame = requestAnimationFrame(tick); }; const run = () => { if (!frame) frame = requestAnimationFrame(tick); }; const down = (event: PointerEvent) => { if (event.button !== 0 || pointer !== null) return; pointer = event.pointerId; element.setPointerCapture?.(pointer); element.setAttribute('data-dragging', ''); startX = event.clientX - x; startY = event.clientY - y; targetX = x; targetY = y; run(); }; const move = (event: PointerEvent) => { if (event.pointerId !== pointer) return; targetX = event.clientX - startX; targetY = event.clientY - startY; }; const up = (event: PointerEvent) => { if (event.pointerId !== pointer) return; pointer = null; if (prefersReducedMotion()) { cancelAnimationFrame(frame); rest(); return; } run(); }; element.addEventListener('pointerdown', down); element.addEventListener('pointermove', move); element.addEventListener('pointerup', up); element.addEventListener('pointercancel', up); element.addEventListener('lostpointercapture', up); return () => { cancelAnimationFrame(frame); element.removeEventListener('pointerdown', down); element.removeEventListener('pointermove', move); element.removeEventListener('pointerup', up); element.removeEventListener('pointercancel', up); element.removeEventListener('lostpointercapture', up); }; }, []); return ( <li ref={chip} data-slot="glass-chip" {...props} className={cn('sprout-glass-chip', className)}> <span data-slot="glass-chip-surface" className="sprout-glass-chip-surface"> {icon && ( <span data-slot="glass-chip-icon" className="sprout-glass-chip-icon"> {icon} </span> )} <span data-slot="glass-chip-label" className="sprout-glass-chip-label"> {children} </span> </span> </li> ); }Add the styles to your global CSS, after
@import "tailwindcss".@layer base { :root, .light { --sprout-glass-banner-ink: oklch(27.78% .0521 267.56); --sprout-glass-banner-ink-soft: oklch(45.68% .0562 268.73); --sprout-glass-banner-base-a: oklch(85.96% .0585 252.45); --sprout-glass-banner-base-b: oklch(95% .0217 250.21); --sprout-glass-banner-glow: oklch(100% 0 0); --sprout-glass-banner-ring: oklch(100% 0 0 / .8); --sprout-glass-banner-edge: oklch(100% 0 0 / .702); --sprout-glass-chip-top: oklch(100% 0 0 / .651); --sprout-glass-chip-bottom: oklch(100% 0 0 / .302); --sprout-glass-chip-edge: oklch(100% 0 0 / .851); --sprout-glass-chip-inner: oklch(73.36% .0864 265.72 / .149); --sprout-glass-chip-shadow: oklch(48.62% .1295 266.33 / .251); --sprout-glass-bubble: oklch(100% 0 0 / .251); } .dark { --sprout-glass-banner-ink: oklch(93.1% .0184 269.08); --sprout-glass-banner-ink-soft: oklch(72.59% .0457 268.05); --sprout-glass-banner-base-a: oklch(25.46% .0397 266.94); --sprout-glass-banner-base-b: oklch(20.52% .0167 268.83); --sprout-glass-banner-glow: oklch(100% 0 0 / .071); --sprout-glass-banner-ring: oklch(100% 0 0 / .102); --sprout-glass-banner-edge: oklch(100% 0 0 / .078); --sprout-glass-chip-top: oklch(100% 0 0 / .102); --sprout-glass-chip-bottom: oklch(100% 0 0 / .031); --sprout-glass-chip-edge: oklch(100% 0 0 / .141); --sprout-glass-chip-inner: oklch(73.36% .0864 265.72 / .063); --sprout-glass-chip-shadow: oklch(0% 0 0 / .502); --sprout-glass-bubble: oklch(100% 0 0 / .039); } @media (prefers-color-scheme: dark) { :root:not(.light):not(.dark) { --sprout-glass-banner-ink: oklch(93.1% .0184 269.08); --sprout-glass-banner-ink-soft: oklch(72.59% .0457 268.05); --sprout-glass-banner-base-a: oklch(25.46% .0397 266.94); --sprout-glass-banner-base-b: oklch(20.52% .0167 268.83); --sprout-glass-banner-glow: oklch(100% 0 0 / .071); --sprout-glass-banner-ring: oklch(100% 0 0 / .102); --sprout-glass-banner-edge: oklch(100% 0 0 / .078); --sprout-glass-chip-top: oklch(100% 0 0 / .102); --sprout-glass-chip-bottom: oklch(100% 0 0 / .031); --sprout-glass-chip-edge: oklch(100% 0 0 / .141); --sprout-glass-chip-inner: oklch(73.36% .0864 265.72 / .063); --sprout-glass-chip-shadow: oklch(0% 0 0 / .502); --sprout-glass-bubble: oklch(100% 0 0 / .039); } } } @layer components { .sprout-glass-banner { --sprout-glass-chip-icon-bg: oklch(100% 0 0 / .902); --sprout-glass-chip-icon-ink: oklch(27.78% .0521 267.56); isolation: isolate; box-sizing: border-box; min-width: 0; min-height: 15rem; font-family: var(--sprout-font); color: var(--sprout-glass-banner-ink); background: radial-gradient(ellipse 22% 85% at 64% 50%, var(--sprout-glass-banner-glow), transparent 70%), radial-gradient(circle at 64% 50%, transparent 0 38%, var(--sprout-glass-banner-ring) 38.2%, transparent 38.8%), radial-gradient(circle at 64% 50%, transparent 0 52%, var(--sprout-glass-banner-ring) 52.2%, transparent 52.8%), linear-gradient(115deg, var(--sprout-glass-banner-base-a), var(--sprout-glass-banner-base-b)); box-shadow: inset 0 0 0 1px var(--sprout-glass-banner-edge); border-radius: 1.25rem; align-content: start; gap: 1.25rem; padding: 1.5rem; display: grid; position: relative; overflow: hidden; container-type: inline-size; } .sprout-glass-banner-art { z-index: -1; border-radius: inherit; pointer-events: none; position: absolute; inset: 0; overflow: hidden; } .sprout-glass-bubble { border: 1px solid var(--sprout-glass-banner-ring); background: radial-gradient(circle at 30% 28%, var(--sprout-glass-banner-glow), var(--sprout-glass-bubble) 75%); border-radius: 9999px; position: absolute; } .sprout-glass-bubble:first-child { width: 4.5rem; height: 4.5rem; top: 52%; left: 6%; } .sprout-glass-bubble:nth-child(2) { width: 1.75rem; height: 1.75rem; top: 46%; left: 30%; } .sprout-glass-bubble:nth-child(3) { width: 9rem; height: 9rem; bottom: -45%; left: -3%; } .sprout-glass-bubble:nth-child(4) { width: 7rem; height: 7rem; top: -30%; left: 30%; } .sprout-glass-bubble:nth-child(5) { width: 12rem; height: 12rem; bottom: -55%; right: -4%; } .sprout-glass-banner-copy { gap: .25rem; min-width: 0; display: grid; } .sprout-glass-banner-title, .sprout-glass-banner-caption { overflow-wrap: anywhere; margin: 0; } .sprout-glass-banner-title { letter-spacing: -.01em; font-size: 1.125rem; font-weight: 500; line-height: 1.5rem; } .sprout-glass-banner-caption { font-size: var(--sprout-text-sm); color: var(--sprout-glass-banner-ink-soft); line-height: 1.25rem; } .sprout-glass-banner-chips { flex-wrap: wrap; align-items: flex-start; gap: .75rem; min-width: 0; margin: 0; padding: 0; list-style: none; display: flex; } .sprout-glass-chip { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; will-change: transform; min-width: 0; max-width: 100%; } .sprout-glass-chip[data-dragging] { z-index: 1; cursor: grabbing; position: relative; } .sprout-glass-chip-surface { box-sizing: border-box; border: 1px solid var(--sprout-glass-chip-edge); background: linear-gradient(180deg, var(--sprout-glass-chip-top), var(--sprout-glass-chip-bottom)); min-height: 2.375rem; box-shadow: inset 0 1px 0 var(--sprout-glass-chip-edge), inset 0 -2px 6px var(--sprout-glass-chip-inner), 0 10px 28px -10px var(--sprout-glass-chip-shadow); -webkit-backdrop-filter: blur(14px) saturate(170%); transition: box-shadow var(--sprout-motion-normal) var(--sprout-motion-ease); border-radius: 9999px; align-items: center; gap: .5rem; padding: .25rem .875rem .25rem .25rem; font-size: .8125rem; line-height: 1.125rem; animation: 7s ease-in-out infinite sprout-glass-float; display: flex; } .sprout-glass-chip-surface:not(:has( > .sprout-glass-chip-icon)) { padding-inline-start: .875rem; } .sprout-glass-chip[data-dragging] .sprout-glass-chip-surface { box-shadow: inset 0 1px 0 var(--sprout-glass-chip-edge), inset 0 -2px 6px var(--sprout-glass-chip-inner), 0 16px 36px -12px var(--sprout-glass-chip-shadow); } .sprout-glass-chip:nth-child(3n+2) .sprout-glass-chip-surface { animation-delay: -2.4s; } .sprout-glass-chip:nth-child(3n+3) .sprout-glass-chip-surface { animation-delay: -4.8s; } .sprout-glass-chip-icon { background: var(--sprout-glass-chip-icon-bg); width: 1.75rem; height: 1.75rem; color: var(--sprout-glass-chip-icon-ink); box-shadow: 0 2px 6px -2px var(--sprout-glass-chip-shadow); border-radius: 9999px; flex-shrink: 0; place-items: center; display: grid; } .sprout-glass-chip-icon > svg { width: 1rem; height: 1rem; } .sprout-glass-chip-label { overflow-wrap: anywhere; min-width: 0; } @container (width >= 44rem) { .sprout-glass-banner-chips:not(:has( > :nth-child(4))) { position: absolute; inset: 0; } .sprout-glass-banner-chips:not(:has( > :nth-child(4))) > .sprout-glass-chip { position: absolute; } .sprout-glass-banner-chips:not(:has( > :nth-child(4))) > .sprout-glass-chip:first-child { top: 15%; right: 9%; } .sprout-glass-banner-chips:not(:has( > :nth-child(4))) > .sprout-glass-chip:first-child .sprout-glass-chip-surface { rotate: 3deg; } .sprout-glass-banner-chips:not(:has( > :nth-child(4))) > .sprout-glass-chip:nth-child(2) { top: 58%; left: 7%; } .sprout-glass-banner-chips:not(:has( > :nth-child(4))) > .sprout-glass-chip:nth-child(2) .sprout-glass-chip-surface { rotate: -4deg; } .sprout-glass-banner-chips:not(:has( > :nth-child(4))) > .sprout-glass-chip:nth-child(3) { top: 72%; left: 47%; } .sprout-glass-banner-chips:not(:has( > :nth-child(4))) > .sprout-glass-chip:nth-child(3) .sprout-glass-chip-surface { rotate: 1.5deg; } } @keyframes sprout-glass-float { 50% { transform: translateY(-4px); } } @media (prefers-reduced-motion: reduce) { .sprout-glass-chip-surface { transition: none; animation: none; } } }Import it from
@/components/ui/glass-banner. Update the paths if your@/alias points elsewhere.
pnpm add @tulipfarm/sprout@import "tailwindcss";
@import "@tulipfarm/sprout/styles.css";The package keeps the source and ships fixes with each release. Import from @tulipfarm/sprout/glass-banner.
App activity · wide · caption · icons
Usage
import { BrandIcon } from "@tulipfarm/sprout/brand-icon";
import { GlassBanner, GlassChip } from "@tulipfarm/sprout/glass-banner";
<GlassBanner title="Connect once. Your agents work there." caption="Example activity">
<GlassChip icon={<BrandIcon brand="gmail" size="glyph" />}>Drafted 3 follow-ups</GlassChip>
<GlassChip icon={<BrandIcon brand="slack" size="glyph" />}>Answered in #support</GlassChip>
<GlassChip icon={<BrandIcon brand="jira" size="glyph" />}>Triaged 5 new issues</GlassChip>
</GlassBanner>GlassBanner takes a title, an optional caption, and GlassChip children. Each chip takes text and an optionalicon, drawn in a 28px white bubble. Brand glyphs and 16px icons both fit. The banner has one size: at least 240px tall with 24px padding. Light and dark modes each have their own glass colors.
Icons and text chips
Chips with an icon pad tightly around the bubble; text-only chips get even padding on both ends. This set mixes both.
Layout
The banner reads its own width, not the window. From 704px wide, up to three chips float over the art at fixed spots, each tilted a little. Narrower banners, or banners with four or more chips, wrap the chips in rows under the title. Long chip text wraps instead of overflowing.
Integrations page
The integrations page opens with the banner when the All filter is on and the search is empty. Searching or picking another filter hides it so results come first. Try it below.
Integrations
Connect the apps your agents work in.
- Gmail
- Slack
- Jira
- GitHub
Apps, filters, and activity here are sample data. The package only draws the banner and its chips.
Accessibility
The bubble art is aria-hidden. Chips are a list named by the caption, or by the title when there is no caption. Dragging is pointer play only: chips are not controls, so they take no focus and keyboard users read them as plain list items. Chips float gently and spring back after a drag; with reduced motion they hold still and snap home as soon as you let go.