Code

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

<ink-sphere
  size="140"
  theme="light"
  elevation="3"
  speed="1"
  aria-label="Play"
>
  <svg viewBox="0 0 24 24" width="1em" height="1em"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor"/></svg>
</ink-sphere>

In context

Play, Orchid
Like, Citrine Pro
Voice, Glacier and Midnight Pro

Install · Free Web Component

One file, no dependencies. Orchid 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/ink-sphere.json
2. Load it and use the element
HTML
<!-- ink-sphere.free.js: download it from the Install section below and host it with your site -->
<script src="/ink-sphere.free.js" defer></script>

<ink-sphere
  size="96"
  theme="light"
  elevation="3"
  speed="1"
  aria-label="Play"
>
  <svg viewBox="0 0 24 24" width="1em" height="1em"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor"/></svg>
</ink-sphere>
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
// ink-sphere.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'ink-sphere': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      size?: number | string;
      theme?: 'light' | 'dark';
      elevation?: number | string;
      speed?: number | string;
    };
  }
}

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, the shared WebGL core and the GLSL source
  • Citrine, Glacier and Midnight inks, plus custom three-colour inks
  • The vanilla Web Component with every ink, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
sound booleanoffPlays a short synthesised a drop of ink (and a tap of vibration on phones) when used. Also on for everything inside an element with data-ui-sound="on".
size number (px)96Diameter of the sphere. The icon scales with it.
theme 'light' | 'dark''light'Shadow and rim for light or dark pages.
elevation 0..53How high it floats: the shadow moves away and softens.
speed number1How fast the ink drifts. 0 freezes it.
tint Pro'orchid' | 'citrine' | 'glacier' | 'midnight''orchid'Ink colours. Free build ships Orchid only.

The ink is a 3D field inside the sphere, so the ribbons fold over each other as they turn rather than sliding across a flat disc. Under the cursor the light and the highlights follow the pointer, the ink quickens and the icon drifts a little the other way, as if it hung inside the glass; a press squeezes the sphere and stirs the ink. The shadow and caustic are drawn past the button's edge, so leave some room below it. Give icon-only buttons an aria-label. Reduced motion freezes the ink; without WebGL a static glass-and-ink gradient stands in. All library components on a page share one WebGL context.

More components