Skip to content

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

fix: add angle prop to retro grid

Dillion Verma0be9bb0a7bd3
diff --git a/content/docs/components/retro-grid.mdx b/content/docs/components/retro-grid.mdx
index 943d89a4..eca4c098 100644
--- a/content/docs/components/retro-grid.mdx
+++ b/content/docs/components/retro-grid.mdx
@@ -98,3 +98,4 @@ module.exports = {
| Prop | Type | Description | Default |
| --------- | ------ | -------------------------------- | ------- |
| className | string | The class name for the component | "" |
+| angle | number | The angle of the grid | 65 |
diff --git a/registry/components/magicui/retro-grid.tsx b/registry/components/magicui/retro-grid.tsx
index ba597583..8f2ed5c2 100644
--- a/registry/components/magicui/retro-grid.tsx
+++ b/registry/components/magicui/retro-grid.tsx
@@ -1,15 +1,22 @@
import { cn } from "@/lib/utils";
-export default function RetroGrid({ className }: { className?: string }) {
+export default function RetroGrid({
+ className,
+ angle = 65,
+}: {
+ className?: string;
+ angle?: number;
+}) {
return (
<div
className={cn(
- "pointer-events-none absolute h-full w-full overflow-hidden opacity-50 [perspective:200px]",
+ "pointer-events-none absolute size-full overflow-hidden opacity-50 [perspective:200px]",
className,
)}
+ style={{ "--grid-angle": `${angle}deg` } as React.CSSProperties}
>
{/* Grid */}
- <div className="absolute inset-0 [transform:rotateX(35deg)]">
+ <div className="absolute inset-0 [transform:rotateX(var(--grid-angle))]">
<div
className={cn(
"animate-grid",