# Progressive blur

A backdrop blur that ramps up toward one edge, with no runtime.

Section: Effects / Light
Page: https://ui.heyramzi.com/components/progressive-blur
Import path: `@heyramzi/ui/effects/progressive-blur`

## Import

```ts
import { ProgressiveBlur } from "@heyramzi/ui/effects/progressive-blur";
```

## Demo

```svelte
<script lang="ts">
	import { ProgressiveBlur } from "@heyramzi/ui/effects/progressive-blur";
</script>

<div class="frame">
	<div class="grid">
		{#each Array(48) as _, i (i)}
			<span class="cell"></span>
		{/each}
	</div>
	<ProgressiveBlur class="fade" direction="bottom" layers={10} intensity={0.6} />
	<span class="label">Progressive blur</span>
</div>

<style>
	.frame {
		position: relative;
		/* A flex row holds the demo, so without a width the frame shrinks to the label. */
		width: 100%;
		height: 9rem;
		overflow: hidden;
		border: 1px solid var(--border);
		border-radius: 0.75rem;
	}
	.grid {
		display: grid;
		grid-template-columns: repeat(8, 1fr);
		gap: 0.25rem;
		padding: 0.5rem;
	}
	.cell {
		height: 1.5rem;
		background: var(--card);
		border-radius: 0.25rem;
	}
	.frame :global(.fade) {
		position: absolute;
		inset-inline: 0;
		bottom: 0;
		height: 60%;
	}
	.label {
		position: absolute;
		bottom: 0.625rem;
		left: 0.75rem;
		font-size: 0.75rem;
		color: var(--foreground);
	}
</style>
```

## API

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `direction` | `"top"` \| `"right"` \| `"bottom"` \| `"left"` | `"bottom"` | Edge the blur builds towards. Default `bottom`. |
| `layers` | `number` | `8` | Stacked masked layers. More layers, smoother ramp, more compositing. |
| `intensity` | `number` | `0.25` | Blur added per layer, in px. |
| `class` | `string` |  |  |
