Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

1.6 KB
Raw Blame
---
title: Backlight
date: 2026-03-27
description: A backlight glow effect for videos, images, and SVGs.
author: abdmjd1
published: true
---

<ComponentPreview name="backlight-video-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>
<TabsContent value="cli">

```bash
npx shadcn@latest add @magicui/backlight
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="backlight" />

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</Tabs>

## Examples

### Image

<ComponentPreview name="backlight-image-demo" />

### SVG

<ComponentPreview name="backlight-svg-demo" />

## Usage

```tsx showLineNumbers
import { Backlight } from "@/components/ui/backlight"
```

```tsx showLineNumbers
<Backlight>
  <img src="https://some-url/image.png" />
</Backlight>
```

## Props

| Prop        | Type                 | Default | Description                                                        |
| ----------- | -------------------- | ------- | ------------------------------------------------------------------ |
| `blur`      | `number`             | `20`    | The blur intensity of the backlight glow effect.                   |
| `children`  | `React.ReactElement` | `-`     | The video, image, or SVG element to apply the backlight effect to. |
| `className` | `string`             | `-`     | Additional class names for the wrapper div.                        |

## Credits

- Credit to [@abdmjd1](https://github.com/abdmjd1)