Copy link⌘CDownload⌘DAdd to favouritesShare

Code

<!-- glass-tip.free.js: download it from the Install section below and host it with your site -->
<script src="/glass-tip.free.js" defer></script>

<glass-tip text="Download" kbd="⌘D" side="top" theme="light">
  <button aria-label="Download">…</button>
</glass-tip>

In context

Copy link⌘CDownload⌘DAdd to favouritesShare
Below the toolbar
Publishes to everyone
Beside a button, Sunset Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/glass-tip.json
2. Load it and use the element
HTML
<!-- glass-tip.free.js: download it from the Install section below and host it with your site -->
<script src="/glass-tip.free.js" defer></script>

<glass-tip text="Download" kbd="⌘D" side="top" theme="light">
  <button aria-label="Download">…</button>
</glass-tip>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// glass-tip.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'glass-tip': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      text?: string;
      kbd?: string;
      side?: 'top' | 'bottom' | 'left' | 'right';
      delay?: number | string;
      open?: boolean | '';
      disabled?: boolean | '';
      theme?: 'light' | 'dark';
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component with TypeScript types and the full source
  • Sunset, Mint and Mono tints, plus custom tints from Brand Fit
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
text string—What the tip says. Keep it to a few words.
kbd string—A keyboard shortcut shown as a small key cap, e.g. "⌘K".
side 'top' | 'bottom' | 'left' | 'right''top'Preferred side; it flips to the opposite one when there is no room, and slides along the edge to stay on screen.
delay number (ms)140Hover time before it appears. Skipped when another tip was showing a moment ago, and on keyboard focus.
open booleanoffKeeps it visible — for onboarding hints.
disabled booleanoffNever shows.
theme 'light' | 'dark''light'White or dark glass.
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Colours of the glint on the rim, or a custom tint. Free build ships Aurora only.

Wrap the control the tip describes. It shows on hover and on keyboard focus, hides on Escape, on press and when the pointer leaves, and is wired to the control with aria-describedby so screen readers read it. A tip is a hint, not a label: an icon-only button still needs its own aria-label. Touch screens have no hover, so nothing essential should live only in a tip. It is positioned inside the wrapper, so a parent with overflow: hidden can clip it.

More components