1
3
Block

Glow Border

PreviousNext

Shine border is an animated background border effect.

import { Button } from "@/components/ui/button"
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { ShineBorder } from "@/components/ui/glow-border"

export function ShineBorderDemo() {
  return (
    <Card className="relative w-full max-w-[350px] overflow-hidden">
      <ShineBorder shineColor={["#A07CFE", "#FE8FB5", "#FFBE7B"]} />
      <CardHeader>
        <CardTitle>Login</CardTitle>
        <CardDescription>
          Enter your credentials to access your account
        </CardDescription>
      </CardHeader>
      <CardContent>
        <form>
          <div className="grid gap-4">
            <div className="grid gap-2">
              <Label htmlFor="email">Email</Label>
              <Input id="email" type="email" placeholder="name@example.com" />
            </div>
            <div className="grid gap-2">
              <Label htmlFor="password">Password</Label>
              <Input id="password" type="password" />
            </div>
          </div>
        </form>
      </CardContent>
      <CardFooter>
        <Button className="w-full">Sign In</Button>
      </CardFooter>
    </Card>
  )
}

Installation

pnpm dlx shadcn@latest add https://ebonui.com/r/glow-border.json

Examples

Monotone

"use client"

import { useTheme } from "next-themes"

import { Button } from "@/components/ui/button"
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { ShineBorder } from "@/components/ui/glow-border"

export function ShineBorderDemo2() {
  const theme = useTheme()
  return (
    <Card className="relative overflow-hidden">
      <ShineBorder shineColor={theme.theme === "dark" ? "white" : "black"} />
      <CardHeader>
        <CardTitle>Login</CardTitle>
        <CardDescription>
          Enter your credentials to access your account
        </CardDescription>
      </CardHeader>
      <CardContent>
        <form>
          <div className="grid gap-4">
            <div className="grid gap-2">
              <Label htmlFor="email">Email</Label>
              <Input id="email" type="email" placeholder="name@example.com" />
            </div>
            <div className="grid gap-2">
              <Label htmlFor="password">Password</Label>
              <Input id="password" type="password" />
            </div>
          </div>
        </form>
      </CardContent>
      <CardFooter>
        <Button className="w-full">Sign In</Button>
      </CardFooter>
    </Card>
  )
}

Usage

import { ShineBorder } from "@/registry/ebonui/glow-border"
<div className="relative h-[500px] w-full overflow-hidden">
  <ShineBorder />
</div>

Props

PropTypeDefaultDescription
classNamestring-The class name to be applied to the component.
durationnumber14Defines the animation duration to be applied on the shining border.
shineColorstring | string[]"#000000"Color of the border, can be a single color or an array of colors.
borderWidthnumber1Width of the border in pixels.
styleReact.CSSProperties-Additional styles to be applied to the component.