Bars Spinner
spell-ui/bars-spinnerFreeComponent
A loading spinner with rotating bars animation.
Live preview
live · rendered by the registry
Rendered by spell-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://spell.sh/r/bars-spinner.jsonSource
1"use client";23import * as React from "react";4import { cn } from "@/lib/utils";56interface BarsSpinnerProps extends React.HTMLAttributes<HTMLDivElement> {7 size?: number;8 color?: string;9}1011export const BarsSpinner = React.forwardRef<HTMLDivElement, BarsSpinnerProps>(12 ({ className, size = 20, color = "currentColor", ...props }, ref) => {13 const bars = Array(12).fill(0);1415 return (16 <div17 ref={ref}18 className={cn("wrapper", className)}19 style={{20 ["--spinner-size" as string]: `${size}px`,21 ["--spinner-color" as string]: color,22 }}23 {...props}24 >25 <div className="spinner">26 {bars.map((_, i) => (27 <div className="bar" key={`spinner-bar-${i}`} />28 ))}29 </div>30 <style jsx>{`31 .wrapper {32 height: var(--spinner-size, 20px);33 width: var(--spinner-size, 20px);34 }3536 .spinner {37 position: relative;38 top: 50%;39 left: 50%;40 height: var(--spinner-size, 20px);41 width: var(--spinner-size, 20px);42 }4344 .bar {45 animation: spin 1.2s linear infinite;46 background: var(--spinner-color);47 border-radius: 6px;48 height: 8%;49 left: -10%;50 position: absolute;51 top: -3.9%;52 width: 24%;53 }5455 .bar:nth-child(1) {56 animation-delay: -1.2s;57 transform: rotate(0.0001deg) translate(146%);58 }5960 .bar:nth-child(2) {61 animation-delay: -1.1s;62 transform: rotate(30deg) translate(146%);63 }6465 .bar:nth-child(3) {66 animation-delay: -1s;67 transform: rotate(60deg) translate(146%);68 }6970 .bar:nth-child(4) {71 animation-delay: -0.9s;72 transform: rotate(90deg) translate(146%);73 }7475 .bar:nth-child(5) {76 animation-delay: -0.8s;77 transform: rotate(120deg) translate(146%);78 }7980 .bar:nth-child(6) {81 animation-delay: -0.7s;82 transform: rotate(150deg) translate(146%);83 }8485 .bar:nth-child(7) {86 animation-delay: -0.6s;87 transform: rotate(180deg) translate(146%);88 }8990 .bar:nth-child(8) {91 animation-delay: -0.5s;92 transform: rotate(210deg) translate(146%);93 }9495// … truncated
Files it writes
More from spell-ui
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Checkboxanimated-checkbox | spell-ui | Components | Free | 1 dep | |
| Animated Gradientanimated-gradient | spell-ui | Components | Free | no deps | |
| Badgebadge | spell-ui | Components | Free | 2 deps | |
| Blur Revealblur-reveal | spell-ui | Components | Free | 1 dep | |
| Chartchart | spell-ui | Components | Free | no deps | |
| Color Selectorcolor-selector | spell-ui | Components | Free | no deps | |
| Copy Buttoncopy-button | spell-ui | Components | Free | 1 dep | |
| Exploding Inputexploding-input | spell-ui | Components | Free | no deps |
