Square Spiral
dotmatrix/dotm-3x3-1FreeComponent
A compact 3×3 grid with a four-dot tail spiraling clockwise from the outer border toward the center.
Install it
npx shadcn@latest add https://dotmatrix.zzzzshawn.cloud/r/dotm-3x3-1.jsonSource
1"use client";23import type { CSSProperties } from "react";45import { DotMatrix3Base } from "@/components/ui/dotmatrix-core";6import { useDotMatrixPhases } from "@/components/ui/dotmatrix-hooks";7import { spiralInward3NormFromIndex, spiralInward3OrderValue, wave3PathOpacityFromNorm } from "@/components/ui/dotmatrix-core";8import { usePrefersReducedMotion } from "@/components/ui/dotmatrix-hooks";9import type { DotAnimationResolver, DotMatrixCommonProps } from "@/components/ui/dotmatrix-core";1011export type Dotm3x3_1Props = DotMatrixCommonProps;1213const animationResolver: DotAnimationResolver = ({ isActive, index, reducedMotion, phase }) => {14 if (!isActive) {15 return { className: "dmx-inactive" };16 }1718 const order = spiralInward3OrderValue(index);19 const pathNorm = spiralInward3NormFromIndex(index);20 const style = { "--dmx-spiral-order": order } as CSSProperties;2122 if (reducedMotion || phase === "idle") {23 return {24 style: {25 ...style,26 opacity: wave3PathOpacityFromNorm(pathNorm)27 }28 };29 }3031 return { className: "dmx-spiral-snake-3", style };32};3334export function Dotm3x3_1({35 speed = 1.15,36 pattern = "full",37 dotShape = "circle",38 animated = true,39 hoverAnimated = false,40 ...rest41}: Dotm3x3_1Props) {42 const reducedMotion = usePrefersReducedMotion();43 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useDotMatrixPhases({44 animated: Boolean(animated && !reducedMotion),45 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),46 speed47 });4849 return (50 <DotMatrix3Base51 {...rest}52 size={rest.size ?? 24}53 dotSize={rest.dotSize ?? 6}54 speed={speed}55 pattern={pattern}56 dotShape={dotShape}57 animated={animated}58 phase={matrixPhase}59 onMouseEnter={onMouseEnter}60 onMouseLeave={onMouseLeave}61 reducedMotion={reducedMotion}62 animationResolver={animationResolver}63 />64 );65}
More from @dotmatrix
All 91 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| All Dot Matrix Loadersall | @dotmatrix | Components | Free | no deps | |
| Frame Chasedotm-3x3-10 | @dotmatrix | Components | Free | no deps | |
| Glyph Pulsedotm-3x3-11 | @dotmatrix | Components | Free | no deps | |
| Drop Rippledotm-3x3-12 | @dotmatrix | Components | Free | no deps | |
| Right Surgedotm-3x3-13 | @dotmatrix | Components | Free | no deps | |
| Comet Traildotm-3x3-14 | @dotmatrix | Components | Free | no deps | |
| Echo Ringsdotm-3x3-15 | @dotmatrix | Components | Free | no deps | |
| Smiley Spindotm-3x3-16 | @dotmatrix | Components | Free | no deps |
