Files
sign/packages/ui/components/animate/animate-generic-fade-in-out.tsx

32 lines
543 B
TypeScript
Raw Permalink Normal View History

import { motion } from 'framer-motion';
type AnimateGenericFadeInOutProps = {
children: React.ReactNode;
className?: string;
2024-03-28 13:13:29 +08:00
motionKey?: string;
};
2024-03-28 13:13:29 +08:00
export const AnimateGenericFadeInOut = ({
children,
className,
motionKey,
}: AnimateGenericFadeInOutProps) => {
return (
<motion.section
2024-03-28 13:13:29 +08:00
key={motionKey}
initial={{
opacity: 0,
}}
animate={{
opacity: 1,
}}
exit={{
opacity: 0,
}}
className={className}
>
{children}
</motion.section>
);
};