Animated Wave
dashboardblocks/animated-waveFreeComponent
An animated wave component.
Live preview
live · rendered by the registry
Rendered by dashboardblocks on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://dashboardblocks.com/r/animated-wave.jsonSource
1export const AnimatedWave = ({2 percentage = 64,3 waveColor = '#3b82f6',4 waveColorSecondary = '#3b82f6',5 waveHeight = 16,6}: {7 percentage?: number8 waveColor?: string9 waveColorSecondary?: string10 waveHeight?: number11}) => {12 return (13 <div className='relative size-full'>14 {/* Wave container */}15 <div16 className='absolute inset-0 transition-transform duration-1000 ease-out'17 style={{18 transform: `translateY(${100 - percentage}%)`,19 }}20 >21 {/* Primary wave */}22 <svg23 className='absolute w-[200%] h-full'24 style={{25 animation: 'wave 3s linear infinite',26 left: 0,27 top: 0,28 }}29 viewBox='0 0 400 200'30 preserveAspectRatio='none'31 >32 <path33 d={`34 M 0 ${waveHeight}35 Q 50 0, 100 ${waveHeight}36 Q 150 ${waveHeight * 2}, 200 ${waveHeight}37 Q 250 0, 300 ${waveHeight}38 Q 350 ${waveHeight * 2}, 400 ${waveHeight}39 L 400 20040 L 0 20041 Z42 `}43 fill={waveColor}44 />45 </svg>4647 {/* Secondary wave (offset) */}48 <svg49 className='absolute w-[200%] h-full opacity-60'50 style={{51 animation: 'wave 4s linear infinite reverse',52 left: 0,53 top: 0,54 }}55 viewBox='0 0 400 200'56 preserveAspectRatio='none'57 >58 <path59 d={`60 M 0 ${waveHeight}61 Q 50 ${waveHeight * 2}, 100 ${waveHeight}62 Q 150 0, 200 ${waveHeight}63 Q 250 ${waveHeight * 2}, 300 ${waveHeight}64 Q 350 0, 400 ${waveHeight}65 L 400 20066 L 0 20067 Z68 `}69 fill={waveColorSecondary}70 />71 </svg>72 </div>7374 {/* Keyframes */}75 <style>{`76 @keyframes wave {77 0% { transform: translateX(0); }78 100% { transform: translateX(-50%); }79 }80 `}</style>81 </div>82 )83}
Files it writes
More from dashboardblocks
All 36 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Feedactivity-feed | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-01activity-feed-01 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-02activity-feed-02 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-03activity-feed-03 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-04activity-feed-04 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-05activity-feed-05 | dashboardblocks | Components | Free | 1 dep | |
| Animated Numberanimated-number | dashboardblocks | Components | Free | no deps | |
| area-chart-kpi-01area-chart-kpi-01 | dashboardblocks | Components | Free | no deps |
