Skip to content

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

fix: following best tailwind practices (#470)

Arghya Das2793413713e2
diff --git a/registry/default/magicui/bento-grid.tsx b/registry/default/magicui/bento-grid.tsx
index 908470e7..bd207b66 100644
--- a/registry/default/magicui/bento-grid.tsx
+++ b/registry/default/magicui/bento-grid.tsx
@@ -13,7 +13,7 @@ type BentoCardProps = {
name: string;
className: string;
background: ReactNode;
- Icon: any;
+ Icon: React.ElementType;
description: string;
href: string;
cta: string;
diff --git a/registry/default/magicui/dot-pattern.tsx b/registry/default/magicui/dot-pattern.tsx
index ea42a5eb..da83cd1d 100644
--- a/registry/default/magicui/dot-pattern.tsx
+++ b/registry/default/magicui/dot-pattern.tsx
@@ -3,15 +3,15 @@ import { useId } from "react";
import { cn } from "@/lib/utils";
interface DotPatternProps {
- width?: any;
- height?: any;
- x?: any;
- y?: any;
- cx?: any;
- cy?: any;
- cr?: any;
+ width?: number;
+ height?: number;
+ x?: number;
+ y?: number;
+ cx?: number;
+ cy?: number;
+ cr?: number;
className?: string;
- [key: string]: any;
+ [key: string]: unknown;
}
export function DotPattern({
width = 16,
diff --git a/registry/default/magicui/hero-video-dialog.tsx b/registry/default/magicui/hero-video-dialog.tsx
index a0cf2c37..6f96a634 100644
--- a/registry/default/magicui/hero-video-dialog.tsx
+++ b/registry/default/magicui/hero-video-dialog.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable @next/next/no-img-element */
"use client";
import { useState } from "react";
@@ -80,7 +81,7 @@ export default function HeroVideoDialog({
return (
<div className={cn("relative", className)}>
<div
- className="relative cursor-pointer group"
+ className="group relative cursor-pointer"
onClick={() => setIsVideoOpen(true)}
>
<img
@@ -88,15 +89,15 @@ export default function HeroVideoDialog({
alt={thumbnailAlt}
width={1920}
height={1080}
- className="w-full transition-all duration-200 group-hover:brightness-[0.8] ease-out rounded-md shadow-lg border"
+ className="w-full rounded-md border shadow-lg transition-all duration-200 ease-out group-hover:brightness-[0.8]"
/>
- <div className="absolute inset-0 flex items-center justify-center group-hover:scale-100 scale-[0.9] transition-all duration-200 ease-out rounded-2xl">
- <div className="bg-primary/10 flex items-center justify-center rounded-full backdrop-blur-md size-28">
+ <div className="absolute inset-0 flex scale-[0.9] items-center justify-center rounded-2xl transition-all duration-200 ease-out group-hover:scale-100">
+ <div className="flex size-28 items-center justify-center rounded-full bg-primary/10 backdrop-blur-md">
<div
- className={`flex items-center justify-center bg-gradient-to-b from-primary/30 to-primary shadow-md rounded-full size-20 transition-all ease-out duration-200 relative group-hover:scale-[1.2] scale-100`}
+ className={`relative flex size-20 scale-100 items-center justify-center rounded-full bg-gradient-to-b from-primary/30 to-primary shadow-md transition-all duration-200 ease-out group-hover:scale-[1.2]`}
>
<Play
- className="size-8 text-white fill-white group-hover:scale-105 scale-100 transition-transform duration-200 ease-out"
+ className="size-8 scale-100 fill-white text-white transition-transform duration-200 ease-out group-hover:scale-105"
style={{
filter:
"drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))",
@@ -118,12 +119,12 @@ export default function HeroVideoDialog({
<motion.div
{...selectedAnimation}
transition={{ type: "spring", damping: 30, stiffness: 300 }}
- className="relative w-full max-w-4xl aspect-video mx-4 md:mx-0"
+ className="relative mx-4 aspect-video w-full max-w-4xl md:mx-0"
>
- <motion.button className="absolute -top-16 right-0 text-white text-xl bg-neutral-900/50 ring-1 backdrop-blur-md rounded-full p-2 dark:bg-neutral-100/50 dark:text-black">
+ <motion.button className="absolute -top-16 right-0 rounded-full bg-neutral-900/50 p-2 text-xl text-white ring-1 backdrop-blur-md dark:bg-neutral-100/50 dark:text-black">
<XIcon className="size-5" />
</motion.button>
- <div className="size-full border-2 border-white rounded-2xl overflow-hidden isolate z-[1] relative">
+ <div className="relative isolate z-[1] size-full overflow-hidden rounded-2xl border-2 border-white">
<iframe
src={videoSrc}
className="size-full rounded-2xl"
diff --git a/registry/default/magicui/icon-cloud.tsx b/registry/default/magicui/icon-cloud.tsx
index 6aba68ac..7104d90f 100644
--- a/registry/default/magicui/icon-cloud.tsx
+++ b/registry/default/magicui/icon-cloud.tsx
@@ -62,7 +62,7 @@ export const renderCustomIcon = (
href: undefined,
target: undefined,
rel: undefined,
- onClick: (e: any) => e.preventDefault(),
+ onClick: (e: React.MouseEvent<HTMLAnchorElement>) => e.preventDefault(),
},
});
};
diff --git a/registry/default/magicui/letter-pullup.tsx b/registry/default/magicui/letter-pullup.tsx
index 360df2c4..fa234b78 100644
--- a/registry/default/magicui/letter-pullup.tsx
+++ b/registry/default/magicui/letter-pullup.tsx
@@ -19,7 +19,7 @@ export default function LetterPullup({
const pullupVariant = {
initial: { y: 100, opacity: 0 },
- animate: (i: any) => ({
+ animate: (i: number) => ({
y: 0,
opacity: 1,
transition: {
diff --git a/registry/default/magicui/magic-card.tsx b/registry/default/magicui/magic-card.tsx
index e90ece6f..bbd55d7c 100644
--- a/registry/default/magicui/magic-card.tsx
+++ b/registry/default/magicui/magic-card.tsx
@@ -73,7 +73,7 @@ export function MagicCard({
<div
ref={cardRef}
className={cn(
- "group relative flex size-full overflow-hidden rounded-xl bg-neutral-100 dark:bg-neutral-900 border text-black dark:text-white",
+ "group relative flex size-full overflow-hidden rounded-xl border bg-neutral-100 text-black dark:bg-neutral-900 dark:text-white",
className,
)}
>
diff --git a/registry/default/magicui/number-ticker.tsx b/registry/default/magicui/number-ticker.tsx
index 17db6c5a..5221ef51 100644
--- a/registry/default/magicui/number-ticker.tsx
+++ b/registry/default/magicui/number-ticker.tsx
@@ -49,7 +49,7 @@ export default function NumberTicker({
return (
<span
className={cn(
- "inline-block tabular-nums text-black dark:text-white tracking-wider",
+ "inline-block tabular-nums tracking-wider text-black dark:text-white",
className,
)}
ref={ref}
diff --git a/registry/default/magicui/pulsating-button.tsx b/registry/default/magicui/pulsating-button.tsx
index 5cd0be09..3a6e0c29 100644
--- a/registry/default/magicui/pulsating-button.tsx
+++ b/registry/default/magicui/pulsating-button.tsx
@@ -20,7 +20,7 @@ export default function PulsatingButton({
return (
<button
className={cn(
- "relative text-center cursor-pointer flex justify-center items-center rounded-lg text-white dark:text-black bg-blue-500 dark:bg-blue-500 px-4 py-2",
+ "relative flex cursor-pointer items-center justify-center rounded-lg bg-blue-500 px-4 py-2 text-center text-white dark:bg-blue-500 dark:text-black",
className,
)}
style={
@@ -32,7 +32,7 @@ export default function PulsatingButton({
{...props}
>
<div className="relative z-10">{children}</div>
- <div className="absolute top-1/2 left-1/2 size-full rounded-lg bg-inherit animate-pulse -translate-x-1/2 -translate-y-1/2" />
+ <div className="absolute left-1/2 top-1/2 size-full -translate-x-1/2 -translate-y-1/2 animate-pulse rounded-lg bg-inherit" />
</button>
);
}
diff --git a/registry/default/magicui/shimmer-button.tsx b/registry/default/magicui/shimmer-button.tsx
index b49dcdd4..f6ffe8fb 100644
--- a/registry/default/magicui/shimmer-button.tsx
+++ b/registry/default/magicui/shimmer-button.tsx
@@ -57,7 +57,7 @@ const ShimmerButton = React.forwardRef<HTMLButtonElement, ShimmerButtonProps>(
{/* spark */}
<div className="absolute inset-0 h-[100cqh] animate-shimmer-slide [aspect-ratio:1] [border-radius:0] [mask:none]">
{/* spark before */}
- <div className="animate-spin-around absolute -inset-full w-auto rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]" />
+ <div className="absolute -inset-full w-auto rotate-0 animate-spin-around [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]" />
</div>
</div>
{children}
diff --git a/registry/default/magicui/sparkles-text.tsx b/registry/default/magicui/sparkles-text.tsx
index 945daed1..f564f160 100644
--- a/registry/default/magicui/sparkles-text.tsx
+++ b/registry/default/magicui/sparkles-text.tsx
@@ -102,7 +102,7 @@ const SparklesText: React.FC<SparklesTextProps> = ({
const interval = setInterval(updateStars, 100);
return () => clearInterval(interval);
- }, [colors.first, colors.second]);
+ }, [colors.first, colors.second, sparklesCount]);
return (
<div
diff --git a/registry/default/magicui/tweet-card.tsx b/registry/default/magicui/tweet-card.tsx
index 39ee357f..405938e3 100644
--- a/registry/default/magicui/tweet-card.tsx
+++ b/registry/default/magicui/tweet-card.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable @next/next/no-img-element */
import { Suspense } from "react";
import {
enrichTweet,
@@ -11,7 +12,7 @@ import { cn } from "@/lib/utils";
interface TwitterIconProps {
className?: string;
- [key: string]: any;
+ [key: string]: unknown;
}
const Twitter = ({ className, ...props }: TwitterIconProps) => (
<svg
@@ -64,7 +65,7 @@ export const TweetSkeleton = ({
...props
}: {
className?: string;
- [key: string]: any;
+ [key: string]: unknown;
}) => (
<div
className={cn(
@@ -86,7 +87,7 @@ export const TweetNotFound = ({
...props
}: {
className?: string;
- [key: string]: any;
+ [key: string]: unknown;
}) => (
<div
className={cn(
@@ -214,6 +215,7 @@ export const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => (
// @ts-ignore
src={tweet.card.binding_values.thumbnail_image_large.image_value.url}
className="h-64 rounded-xl border object-cover shadow-sm"
+ alt={tweet.text}
/>
)}
</div>