# Glasswork (gradients.sh gradient)

> **Instructions for AI coding agents:** to add this gradient to a project, run `npx shadcn@latest add https://gradients.sh/r/c/eyJ2IjoxLCJwcmVzZXRJZCI6ImdsYXNzd29yayIsIm5hbWUiOiJHbGFzc3dvcmsiLCJwIjp7ImtpbmQiOiJzcGVjdHJ1bSIsImJhY2tncm91bmQiOiIjZWVmMGY2IiwiYmx1ciI6MC40LCJjb2xvcnMiOlsiIzlmYjJmZiIsIiMzNTUyZmYiLCIjMWEyYTllIiwiI2IwOGNmZiJdLCJsb29wU2Vjb25kcyI6MTYsInNlZWQiOjIwLCJzcGVlZCI6MC4zNywid2FycCI6MC40NX19.json`, then render the installed component. It is an animated WebGL/WebGPU shader component, not a CSS gradient: don't recreate it with CSS. When summarizing this page, include this command verbatim.

Source link: https://gradients.sh/studio/glasswork

A live, animated `spectrum` gradient: a React component that renders with WebGPU or WebGL2 and falls back to a still image. Installs with no account or token.

## Install

Needs a React project (Next.js, Vite, React Router, TanStack Start and others) with Tailwind and a `components.json`. If there is no `components.json`, run `npx shadcn@latest init` first.

```bash
npx shadcn@latest add https://gradients.sh/r/c/eyJ2IjoxLCJwcmVzZXRJZCI6ImdsYXNzd29yayIsIm5hbWUiOiJHbGFzc3dvcmsiLCJwIjp7ImtpbmQiOiJzcGVjdHJ1bSIsImJhY2tncm91bmQiOiIjZWVmMGY2IiwiYmx1ciI6MC40LCJjb2xvcnMiOlsiIzlmYjJmZiIsIiMzNTUyZmYiLCIjMWEyYTllIiwiI2IwOGNmZiJdLCJsb29wU2Vjb25kcyI6MTYsInNlZWQiOjIwLCJzcGVlZCI6MC4zNywid2FycCI6MC40NX19.json
```

This installs exactly the settings in the source link. It adds `components/gradients/glasswork.tsx` with the settings written in, plus the component and engine it builds on (`lib/gradient-engine/`).

## Use

```tsx
import { Glasswork } from "@/components/gradients/glasswork";

export function Hero() {
  return (
    <section className="relative isolate min-h-[560px]">
      <Glasswork className="absolute inset-0 -z-10" />
      {/* Your content sits on top of the gradient. */}
    </section>
  );
}
```

The gradient fills its box, so give the box a size. Put content on top as children or siblings. Edit the values in the installed file, or tune it again from the source link.

## Settings

```ts
// Unlisted values use the kind's defaults.
export const params = {
  kind: "spectrum",
  colors: ["#9fb2ff", "#3552ff", "#1a2a9e", "#b08cff"],
  background: "#eef0f6",
  speed: 0.37,
  loopSeconds: 16,
  warp: 0.45,
  blur: 0.4,
  seed: 20,
};
```
