# Soap Film

> WebGL soap film draining in its frame. Gravity thins it to black at the top, slow convection and rising plumes churn the soap, and every color is real thin-film interference summed across the visible spectrum, so the bands run gold, magenta, blue and green in their true order. Pastel over a light box by day, vivid against black at night. The pointer blows eddies into the film.

- Slug: `soap-film`
- Category: [Backgrounds](https://www.assembli.design/category/backgrounds.md)
- Type: block
- Tags: webgl, shader, iridescent, bubble, holographic, pointer
- npm dependencies: motion
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/soap-film
- Page: https://www.assembli.design/components/soap-film

![Soap Film preview](https://www.assembli.design/thumbnails/soap-film-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | `"auto" \| "light" \| "dark"` | `"auto"` | Follow the page theme (a film over a light box by day, against black at night), or force one. |
| `thickness` | `number` | `1500` | How thick the film runs at the bottom, in nanometres: thicker shows more, paler bands. |
| `swirl` | `number` | `0.6` | How much the film churns, 0 (glassy bands) to 1 (turbulent). |
| `vivid` | `number` | `0.7` | Strength of the color in light mode, 0 (pearl) to 1 (vivid). |
| `speed` | `number` | `1` | Time scale. 0 holds the film still. |
| `interactive` | `boolean` | `true` | Moving the pointer blows eddies into the film. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/soap-film/soap-film.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/soap-film
```

Registry item JSON: https://www.assembli.design/r/soap-film.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
