Sparkles Branding
Sparkles Branding is a React and Tailwind CSS effect component from UI Layouts, licensed MIT. Copy it and paste it into your project.
UI Layouts
MIT
effects
What it is
Sparkles Branding is a React and Tailwind CSS effect component from UI Layouts, licensed MIT. Copy it and paste it into your project.
How to use it
Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.
Five free copies a month. No card.
No packages beyond the project baseline
Licence
This component comes from UI Layouts and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.
Sparkles Branding
import React from 'react';
import Image from 'next/image';
import { Sparkles } from '@/components/sparkles';
function index() {
return (
<>
<main className=' h-screen w-full overflow-hidden bg-black text-white '>
<section className='container mx-auto relative h-[90vh] mt-4 border border-white/10 w-full overflow-hidden rounded-2xl'>
<Image
src='https://res.cloudinary.com/dzl9yxixg/image/upload/bg-image_inxjdx.png'
width={1000}
height={1000}
className='w-full h-full absolute top-0 left-0'
alt='bg-image'
/>
<article className='grid gap-4 text-center relative z-10 pt-10'>
<span className='inline-block xl:text-base text-sm border p-1 px-3 w-fit mx-auto rounded-full border-[#3273ff] bg-[#0f1c35]'>
Early Access
</span>
<h1 className='2xl:text-6xl xl:text-5xl text-5xl font-semibold bg-linear-to-b from-[#edeffd] to-[#7b9cda] bg-clip-text text-transparent leading-[100%] tracking-tighter'>
Become an Animation Expert <br /> Easily at Our Academy
</h1>
<span>
Our expert-led courses are perfect for all skill levels. Gain{' '}
<br />
hands-on experience and create stunning animations <br />{' '}
effortlessly. Join us today!
</span>
<button className='border border-blue-400 w-fit p-2 px-4 rounded-md bg-blue-900/40 hover:bg-blue-900/60 backdrop-blur-2xl mx-auto text-white'>
Take The Course
</button>
</article>
<div className='absolute bottom-0 z-2 h-[400px] w-screen overflow-hidden mask-[radial-gradient(100%_50%,white,transparent)] before:absolute before:inset-0 before:bg-[radial-gradient(circle_at_bottom_center,#3273ff,transparent_90%)] before:opacity-40 after:absolute'>
<Sparkles
density={1800}
speed={1.2}
color='#48b6ff'
direction='top'
className='absolute inset-x-0 bottom-0 h-full w-full '
/>
</div>
</section>
</main>
</>
);
}
export default index;
'use client';
import { useEffect, useId, useState } from 'react';
import Particles, { initParticlesEngine } from '@tsparticles/react';
import { loadSlim } from '@tsparticles/slim';
interface SparklesProps {
className?: string;
size?: number;
minSize?: number | null;
density?: number;
speed?: number;
minSpeed?: number | null;
opacity?: number;
direction?: string;
opacitySpeed?: number;
minOpacity?: number | null;
color?: string;
mousemove?: boolean;
hover?: boolean;
background?: string;
options?: Record<string, any>; // Adjust type as needed based on `options` structure
}
export function Sparkles({
className,
size = 1.2,
minSize = null,
density = 800,
speed = 1.5,
minSpeed = null,
opacity = 1,
direction = '',
opacitySpeed = 3,
minOpacity = null,
color = '#ffffff',
mousemove = false,
hover = false,
background = 'transparent',
options = {},
}: SparklesProps) {
const [isReady, setIsReady] = useState(false);
useEffect(() => {
initParticlesEngine(async (engine) => {
await loadSlim(engine);
}).then(() => {
setIsReady(true);
});
}, []);
const id = useId();
const defaultOptions = {
background: {
color: {
value: background,
},
},
fullScreen: {
enable: false,
zIndex: 1,
},
fpsLimit: 300,
interactivity: {
events: {
onClick: {
enable: true,
mode: 'push',
},
onHover: {
enable: hover,
mode: 'grab',
parallax: {
enable: mousemove,
force: 60,
smooth: 10,
},
},
resize: true as any,
},
modes: {
push: {
quantity: 4,
},
repulse: {
distance: 200,
duration: 0.4,
},
},
},
particles: {
color: {
value: color,
},
move: {
enable: true,
direction,
speed: {
min: minSpeed || speed / 130,
max: speed,
},
straight: true,
},
collisions: {
absorb: {
speed: 2,
},
bounce: {
horizontal: {
value: 1,
},
vertical: {
value: 1,
},
},
enable: false,
maxSpeed: 50,
mode: 'bounce',
overlap: {
enable: true,
retries: 0,
},
},
number: {
value: density,
},
opacity: {
value: {
min: minOpacity || opacity / 10,
max: opacity,
},
animation: {
enable: true,
sync: false,
speed: opacitySpeed,
},
},
size: {
value: {
min: minSize || size / 1.5,
max: size,
},
},
},
detectRetina: true,
};
return (
isReady && (
<Particles id={id}
// @ts-nocheck
options={defaultOptions} className={className} />
)
);
}