# Window Light

> WebGL sunlight falling through a window and a tree onto a plaster wall. Mullion shadows soften with distance, leaves at two depths flutter in a gusting breeze, penumbras run warm and the light rakes across the plaster. Five hours from morning to moonlight; pointer movement stirs the wind. Pauses off-screen and holds a still frame for reduced motion.

- Slug: `window-light`
- Category: [Backgrounds](https://www.assembli.design/category/backgrounds.md)
- Type: block
- Tags: webgl, shader, light, shadow, leaves, calm
- npm dependencies: motion
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/window-light
- Page: https://www.assembli.design/components/window-light

![Window Light preview](https://www.assembli.design/thumbnails/window-light-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `hour` | `WindowHour` | `"afternoon"` | Light in light mode. |
| `darkHour` | `WindowHour` | `"moon"` | Light in dark mode. |
| `mode` | `"auto" \| "light" \| "dark"` | `"auto"` | Follow the page theme, or force one. |
| `wind` | `number` | `0.5` | Breeze strength, 0 (still air) to 1 (gusty). Moving the pointer stirs it too. |
| `foliage` | `number` | `0.7` | How much tree stands outside the window, 0 to 1. |
| `panes` | `[number, number]` | `[3, 2]` | Window panes across and down. |
| `speed` | `number` | `1` | Time scale. 0 holds the leaves still. |
| `interactive` | `boolean` | `true` | Pointer movement gusts the breeze. |

## 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/window-light/window-light.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/window-light
```

Registry item JSON: https://www.assembli.design/r/window-light.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.
