Haz animado
NuevoMITHaces de luz que viajan entre nodos: ideal para mostrar integraciones, redes o flujos de datos.
API
DB
IA
BS
TÚ
Ajústalo
60
4
0.2
Instalación
Terminal
npx shadcn@latest add https://<tu-dominio>/r/haz-animado.json
Crea components/bastard/AnimatedBeam.tsx e instala motion. Más opciones
Uso
Demo.tsx
1'use client';23import { useRef } from 'react';4import { AnimatedBeam } from '@/components/bastard/AnimatedBeam';56export default function Demo() {7 const containerRef = useRef<HTMLDivElement>(null);8 const fromRef = useRef<HTMLDivElement>(null);9 const toRef = useRef<HTMLDivElement>(null);1011 return (12 <div ref={containerRef} className="relative flex w-full items-center justify-between p-10">13 <div ref={fromRef} className="z-10 size-12 rounded-full border bg-black" />14 <div ref={toRef} className="z-10 size-12 rounded-full border bg-black" />15 <AnimatedBeam16 containerRef={containerRef}17 fromRef={fromRef}18 toRef={toRef}19 curvature={60}20 duration={4}21 pathOpacity={0.2}22 gradientStartColor="#e8743b"23 gradientStopColor="#5b7bff"24 />25 </div>26 );27}
Props
| Prop | Tipo | Por defecto | Descripción |
|---|---|---|---|
| gradientStartColor | string | "#e8743b" | Color inicial |
| gradientStopColor | string | "#5b7bff" | Color final |
| curvature | number | 60 | Curvatura |
| duration | number | 4 | Duración (s) |
| pathOpacity | number | 0.2 | Opacidad del cable |
| reverse | boolean | false | En reversa |
Aquí aparecen las props ajustables. El componente acepta más: revisa el código fuente.
Créditos
Basado en Animated Beam · Magic UI, adaptado para BSTRD UI.Licencia: MIT. Puedes usarlo, modificarlo y venderlo, conservando el aviso de copyright que va dentro del archivo.