Skip to content

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

fix(blur-fade): `margin` type (#261)

Hyden Liuf6834ded5412
diff --git a/content/docs/components/blur-fade.mdx b/content/docs/components/blur-fade.mdx
index a9adb39b..77b3a5ed 100644
--- a/content/docs/components/blur-fade.mdx
+++ b/content/docs/components/blur-fade.mdx
@@ -55,5 +55,5 @@ npx magicui-cli add blur-fade
| delay | number | Delay (seconds) before the animation starts | 0 |
| yOffset | number | Vertical offset for the animation | 6 |
| inView | boolean | Whether to trigger animation when component is in view | false |
-| inViewMargin | string | Margin for triggering the in-view animation | "-50px" |
+| inViewMargin | MarginType | Margin for triggering the in-view animation | "-50px" |
| blur | string | Amount of blur to apply during the animation | "6px" |
diff --git a/registry/components/magicui/blur-fade.tsx b/registry/components/magicui/blur-fade.tsx
index 8204c7f0..44e897ee 100644
--- a/registry/components/magicui/blur-fade.tsx
+++ b/registry/components/magicui/blur-fade.tsx
@@ -1,7 +1,15 @@
"use client";
import { useRef } from "react";
-import { AnimatePresence, motion, useInView, Variants } from "framer-motion";
+import {
+ AnimatePresence,
+ motion,
+ useInView,
+ UseInViewOptions,
+ Variants,
+} from "framer-motion";
+
+type MarginType = UseInViewOptions["margin"];
interface BlurFadeProps {
children: React.ReactNode;
@@ -14,7 +22,7 @@ interface BlurFadeProps {
delay?: number;
yOffset?: number;
inView?: boolean;
- inViewMargin?: string;
+ inViewMargin?: MarginType;
blur?: string;
}