border-beam-button-demo
cult-ui/border-beam-button-demoUnverifiedComponent
cult/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/nolly-studio/cult-ui/HEAD/apps/www/border-beam-button-demo.jsonSource
1"use client"23import { useEffect, useId, useState, type ReactNode } from "react"4import type { BorderBeamColorVariant } from "border-beam"5import { ArrowRight, Pause, Play, Sparkles, Wand2, Zap } from "lucide-react"67import { cn } from "@/lib/utils"8import {9 BorderBeamButton,10 BorderBeamIconButton,11} from "@/registry/default/ui/border-beam-button"1213const COLOR_ROW: { key: BorderBeamColorVariant; label: string }[] = [14 { key: "colorful", label: "Colorful" },15 { key: "ocean", label: "Ocean" },16 { key: "sunset", label: "Sunset" },17 { key: "mono", label: "Mono" },18]1920const BEAM_SIZES = ["sm", "md", "line"] as const2122function Section({23 title,24 description,25 children,26}: {27 title: string28 description?: string29 children: ReactNode30}) {31 return (32 <section className="space-y-4">33 <div className="space-y-1">34 <h3 className="font-semibold text-foreground text-sm tracking-tight">35 {title}36 </h3>37 {description ? (38 <p className="text-pretty text-muted-foreground text-xs leading-relaxed">39 {description}40 </p>41 ) : null}42 </div>43 {children}44 </section>45 )46}4748export default function BorderBeamButtonDemo() {49 const id = useId()50 const [beamActive, setBeamActive] = useState(true)51 const [respectsReducedMotion, setRespectsReducedMotion] = useState(false)5253 useEffect(() => {54 const mq = window.matchMedia("(prefers-reduced-motion: reduce)")55 const sync = () => setRespectsReducedMotion(mq.matches)56 sync()57 mq.addEventListener("change", sync)58 return () => mq.removeEventListener("change", sync)59 }, [])6061 const effectiveActive = beamActive && !respectsReducedMotion6263 return (64 <div className="mx-auto w-full max-w-3xl space-y-10 px-4 py-8 md:px-6">65 <header className="space-y-2 text-center">66 <p className="font-medium text-[11px] text-muted-foreground uppercase tracking-[0.2em]">67 Border beam68 </p>69 <h2 className="font-semibold text-foreground text-xl tracking-tight md:text-2xl">70 Button + traveling glow71 </h2>72 <p className="mx-auto max-w-lg text-pretty text-muted-foreground text-sm leading-relaxed">73 <span className="text-foreground/90">className</span> targets the74 shadcn <span className="text-foreground/90">Button</span>;{" "}75 <span className="text-foreground/90">borderBeamClassName</span> styles76 the beam wrapper. Use{" "}77// … truncated
What it pulls in
Other registry items
Files it writes
More from cult/ui
All 157 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-instructionsai-instructions | cult/ui | Components | Unverified | 2 deps | |
| ai-instructions-demoai-instructions-demo | cult/ui | Components | Unverified | no deps | |
| animated-numberanimated-number | cult/ui | Components | Unverified | 1 dep | |
| animated-number-demoanimated-number-demo | cult/ui | Components | Unverified | no deps | |
| bg-animate-buttonbg-animate-button | cult/ui | Components | Unverified | no deps | |
| bg-animate-button-demobg-animate-button-demo | cult/ui | Components | Unverified | no deps | |
| bg-animated-fractal-dot-gridbg-animated-fractal-dot-grid | cult/ui | Components | Unverified | 1 dep | |
| bg-animated-fractal-dot-grid-demobg-animated-fractal-dot-grid-demo | cult/ui | Components | Unverified | no deps |
