BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Animated Theme Toggles/spin

Spin Theme Toggle

animated-theme-toggles/spin
FreeBlock

Animated Theme Toggles publishes no description for this item.

Install it

npx shadcn@latest add https://toggles.dev/r/spin.json

Source

src/Spin.tsxtoggles.dev/r/spin.json
1import { type ButtonHTMLAttributes, type CSSProperties, useId } from "react";
2
3export interface SpinProps extends Omit<
4 ButtonHTMLAttributes<HTMLButtonElement>,
5 "children"
6> {
7 duration?: number;
8 [key: `data-${string}`]: string | number | boolean | null | undefined;
9}
10
11export function Spin({
12 duration = 400,
13 className,
14 type = "button",
15 title = "Toggle theme",
16 "aria-label": ariaLabel = "Toggle theme",
17 ...props
18}: SpinProps) {
19 const toggleId = useId();
20
21 const clipMainId = `toggles.dev-spin-main-${toggleId}`;
22
23 return (
24 <button
25 type={type}
26 title={title}
27 aria-label={ariaLabel}
28 className={className}
29 {...props}
30 >
31 <svg
32 width="1em"
33 height="1em"
34 viewBox="0 0 24 24"
35 aria-hidden="true"
36 style={{ "--toggles-spin--duration": `${duration}ms` } as CSSProperties}
37 >
38 <defs>
39 <clipPath id={clipMainId}>
40 <path
41 d={"M0 0h25a1 1 0 0010 10v14H0Z"}
42 className="transition-[d,translate] duration-(--toggles-spin--duration) dark:delay-[calc(var(--toggles-spin--duration)*0.15)] dark:[d:path('M0_2h13a1_1_0_0010_10v14H0Z')] dark:not-supports-[d:path('M0_0')]:-translate-x-3.25 dark:not-supports-[d:path('M0_0')]:translate-y-0.5"
43 />
44 </clipPath>
45 </defs>
46 <g stroke={"currentColor"} strokeLinecap={"round"}>
47 <circle
48 cx={12}
49 cy={12}
50 r={5}
51 fill={"currentColor"}
52 clipPath={`url(#${clipMainId})`}
53 className="origin-center transition-transform duration-(--toggles-spin--duration) dark:scale-170"
54 />
55 <path
56 d={"M12 1.4v2.4"}
57 fill={"none"}
58 strokeWidth={2}
59 strokeLinejoin={"round"}
60 strokeMiterlimit={0}
61 paintOrder={"stroke markers fill"}
62 className="origin-center transition-transform duration-(--toggles-spin--duration) delay-[calc(var(--toggles-spin--duration)*0.15)] dark:delay-0 dark:rotate-45 dark:scale-0"
63 />
64 <path
65 d={"m20.3 3.7-2.5 2.5"}
66 fill={"none"}
67 strokeWidth={2}
68 strokeLinejoin={"round"}
69 strokeMiterlimit={0}
70 paintOrder={"stroke markers fill"}
71 className="origin-center transition-transform duration-(--toggles-spin--duration) delay-[calc(var(--toggles-spin--duration)*0.15)] dark:delay-0 dark:rotate-45 dark:scale-0"
72// … truncated

Files it writes

  • src/Spin.tsx

Facts

Registry
Animated Theme Toggles
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

toggles.dev AlfieJones/theme-toggles on GitHub Raw registry item This item as JSON

More from Animated Theme Toggles

All 14 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Around Theme TogglearoundAnimated Theme TogglesBlocksFreeno deps
Classic Theme ToggleclassicAnimated Theme TogglesBlocksFreeno deps
Dark Inner Theme Toggledark-innerAnimated Theme TogglesBlocksFreeno deps
Dark Side Theme Toggledark-sideAnimated Theme TogglesBlocksFreeno deps
Eclipse Theme ToggleeclipseAnimated Theme TogglesBlocksFreeno deps
Expand Theme ToggleexpandAnimated Theme TogglesBlocksFreeno deps
Half Sun Theme Togglehalf-sunAnimated Theme TogglesBlocksFreeno deps
Horizon Theme TogglehorizonAnimated Theme TogglesBlocksFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex