orbit-rotation
eldoraui/orbit-rotationFreeComponent
An orbit rotation component with customizable icons.
Live preview
live · rendered by the registry
Rendered by eldoraui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://eldoraui.site/r/orbit-rotation.jsonSource
1"use client"23import type React from "react"4import {5 FaApple,6 FaAws,7 FaDocker,8 FaGithub,9 FaGoogle,10 FaInstagram,11 FaLinkedin,12 FaNodeJs,13 FaReact,14 FaTwitter,15} from "react-icons/fa"16import {17 SiFacebook,18 SiNextdotjs,19 SiRedux,20 SiTypescript,21 SiVercel,22} from "react-icons/si"2324import { cn } from "@/lib/utils"2526interface OrbitIcon {27 Icon: React.ComponentType<{ className?: string }>28 name?: string29}3031interface OrbitRotationProps {32 icons?: OrbitIcon[]33 orbitCount?: number34 orbitGap?: number35 centerIcon?: OrbitIcon36 className?: string37 size?: "sm" | "md" | "lg"38}3940const defaultIcons: OrbitIcon[] = [41 { Icon: FaReact, name: "React" },42 { Icon: FaAws, name: "AWS" },43 { Icon: FaDocker, name: "Docker" },44 { Icon: FaNodeJs, name: "Node.js" },45 { Icon: SiNextdotjs, name: "Next.js" },46 { Icon: SiVercel, name: "Vercel" },47 { Icon: SiRedux, name: "Redux" },48 { Icon: SiTypescript, name: "TypeScript" },49 { Icon: FaGithub, name: "GitHub" },50 { Icon: FaTwitter, name: "Twitter" },51 { Icon: FaLinkedin, name: "LinkedIn" },52 { Icon: FaInstagram, name: "Instagram" },53 { Icon: FaGoogle, name: "Google" },54 { Icon: FaApple, name: "Apple" },55 { Icon: SiFacebook, name: "Facebook" },56]5758const defaultCenterIcon: OrbitIcon = {59 Icon: FaReact,60 name: "React",61}6263export function OrbitRotation({64 icons = defaultIcons,65 orbitCount = 3,66 orbitGap = 6,67 centerIcon = defaultCenterIcon,68 className,69 size = "md",70 ...props71}: OrbitRotationProps) {72 const iconsPerOrbit = Math.ceil(icons.length / orbitCount)7374 const sizeClasses = {75 sm: "w-16 h-16",76 md: "w-24 h-24",77 lg: "w-32 h-32",78 }7980 const iconSizeClasses = {81 sm: "w-6 h-6",82 md: "w-8 h-8",83 lg: "w-10 h-10",84 }8586 return (87 <div88 className={cn("relative flex items-center justify-center", className)}89 {...props}90 >91 <div className="relative flex items-center justify-center">92 {/* Center Icon */}93 <div94 className={cn(95 "bg-background/90 border-border/50 flex items-center justify-center rounded-full border shadow-xl backdrop-blur-sm",96 sizeClasses[size]97 )}98 >99 <centerIcon.Icon className={cn(iconSizeClasses[size])} />100 </div>101102 {/* Generate Orbits */}103 {[...Array(orbitCount)].map((_, orbitIdx) => {104 const orbitSize = `${8 + orbitGap * (orbitIdx + 1)}rem`105 const angleStep = (2 * Math.PI) / iconsPerOrbit106// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from eldoraui
All 115 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| animated-badgeanimated-badge | eldoraui | Components | Free | 2 deps | |
| animated-frameworksanimated-frameworks | eldoraui | Components | Free | 2 deps | |
| animated-grid-patternanimated-grid-pattern | eldoraui | Components | Free | 3 deps | |
| animated-listanimated-list | eldoraui | Components | Free | 1 dep | |
| animated-shiny-buttonanimated-shiny-button | eldoraui | Components | Free | 1 dep | |
| blur-in-textblur-in-text | eldoraui | Components | Free | 3 deps | |
| browserbrowser | eldoraui | Components | Free | 2 deps | |
| card-flip-hovercard-flip-hover | eldoraui | Components | Free | 1 dep |
