Skip to content

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

🐛 fix: number ticker and retro grid fixes

Dillion Verma01a9f2f010a0
diff --git a/registry/components/magicui/number-ticker.tsx b/registry/components/magicui/number-ticker.tsx
index 1fa17cf0..407aac55 100644
--- a/registry/components/magicui/number-ticker.tsx
+++ b/registry/components/magicui/number-ticker.tsx
@@ -6,9 +6,11 @@ import { useEffect, useRef } from "react";
export default function NumberTicker({
value,
direction = "up",
+ className,
}: {
value: number;
direction?: "up" | "down";
+ className?: string;
}) {
const ref = useRef<HTMLSpanElement>(null);
const motionValue = useMotionValue(direction === "down" ? value : 0);
@@ -36,5 +38,7 @@ export default function NumberTicker({
[springValue],
);
- return <span ref={ref} />;
+ return (
+ <span className={`w-full text-right tabular-nums ${className}`} ref={ref} />
+ );
}
diff --git a/registry/components/magicui/retro-grid.tsx b/registry/components/magicui/retro-grid.tsx
index 8d7d3c51..1a926cb1 100644
--- a/registry/components/magicui/retro-grid.tsx
+++ b/registry/components/magicui/retro-grid.tsx
@@ -1,43 +1,32 @@
import { cn } from "@/lib/utils";
-const RetroGrid = ({ className }: { className?: string }) => {
- const gridLinesStyle = {
- backgroundSize: "60px 60px",
- backgroundRepeat: "repeat",
- transformOrigin: "100% 0 0",
- inset: "-100% 0px",
- width: "200vw",
- height: "100vh",
- marginLeft: "-50%",
- };
-
+export default function RetroGrid({ className }: { className?: string }) {
return (
<div
className={cn(
- "absolute h-full w-full overflow-hidden [perspective:400px]",
+ "absolute h-full w-full overflow-hidden [perspective:200px]",
className,
)}
>
{/* Grid */}
- <div className="absolute inset-0 [transform:rotateX(55deg)]">
+ <div className="absolute inset-0 [transform:rotateX(45deg)]">
<div
className={cn(
"animate-grid",
+ "[background-repeat:repeat] [background-size:60px_60px] [height:100vh] [inset:0%_0px] [margin-left:-50%] [transform-origin:100%_0_0] [width:200vw]",
+
// Light Styles
"[background-image:linear-gradient(to_right,rgba(0,0,0,0.3)_1px,transparent_0),linear-gradient(to_bottom,rgba(0,0,0,0.3)_1px,transparent_0)]",
// Dark styles
"dark:[background-image:linear-gradient(to_right,rgba(255,255,255,0.2)_1px,transparent_0),linear-gradient(to_bottom,rgba(255,255,255,0.2)_1px,transparent_0)]",
)}
- style={gridLinesStyle}
/>
</div>
{/* Background Gradient */}
- <div className="absolute inset-0 bg-gradient-to-b from-white from-10% to-transparent dark:from-black" />
+ <div className="absolute inset-0 bg-gradient-to-b from-white to-transparent to-60% dark:from-black" />
</div>
);
-};
-
-export default RetroGrid;
+}