This card showcases a dynamic border beam effect, adding a subtle, animated glow around the edges.
"use client"
import { useEffect, useState } from "react"
import { useTheme } from "next-themes"
import { BorderBeam } from "@/components/ui/border-beam"
export function BorderBeamDemo() {
const { theme } = useTheme()
const [lightColor, setLightColor] = useState("#FAFAFA")
useEffect(() => {
setLightColor(theme === "dark" ? "#FAFAFA" : "#FF2056")
}, [theme])
return (
<div className="relative overflow-hidden rounded-lg shadow-sm">
<BorderBeam lightColor={lightColor} lightWidth={350} duration={8} />
<div className="h-full w-full max-w-72 space-y-2 px-6 py-4">
<h3 className="font-gilroy text-2xl">Border Beam</h3>
<p className="text-sm">
This card showcases a dynamic border beam effect, adding a subtle,
animated glow around the edges.
</p>
</div>
</div>
)
}
pnpm dlx shadcn@latest add https://badtz-ui.com/r/border-beam.json
import { BorderBeam } from "@/components/ui/border-beam";
<div className="relative rounded-lg shadow-sm">
<BorderBeam lightColor="#FAFAFA" lightWidth={350} duration={8} />
<div className="h-full w-full py-4 px-6 max-w-72 space-y-2">
<h3 className="font-gilroy text-2xl">Border Beam</h3>
<p className="text-sm">
This card showcases a dynamic border beam effect, adding a subtle,
animated glow around the edges.
</p>
</div>
</div>
border-beam
props.
Prop | Type | Default |
---|---|---|
lightWidth? | number | 200 |
duration? | number | 10 |
lightColor? | string | "#FAFAFA" |
borderWidth? | number | 1 |
className? | string | - |
props? | Record<string, any> | - |
This component is inspired by Resend
On This Page