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/within

Within Theme Toggle

animated-theme-toggles/within
FreeBlock

Animated Theme Toggles publishes no description for this item.

Install it

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

Source

src/Within.tsxtoggles.dev/r/within.json
1import { type ButtonHTMLAttributes, type CSSProperties, useId } from "react";
2
3export interface WithinProps extends Omit<
4 ButtonHTMLAttributes<HTMLButtonElement>,
5 "children"
6> {
7 duration?: number;
8 [key: `data-${string}`]: string | number | boolean | null | undefined;
9}
10
11export function Within({
12 duration = 500,
13 className,
14 type = "button",
15 title = "Toggle theme",
16 "aria-label": ariaLabel = "Toggle theme",
17 ...props
18}: WithinProps) {
19 const toggleId = useId();
20
21 const clipMainId = `toggles.dev-within-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 32 32"
35 aria-hidden="true"
36 fill={"currentColor"}
37 style={
38 { "--toggles-within--duration": `${duration}ms` } as CSSProperties
39 }
40 >
41 <defs>
42 <clipPath id={clipMainId}>
43 <path d={"M0 0h32v32h-32ZM6 16A1 1 0 0026 16 1 1 0 006 16"} />
44 </clipPath>
45 </defs>
46 <g clipPath={`url(#${clipMainId})`}>
47 <path
48 d={
49 "M30.7 21.3 27.1 16l3.7-5.3c.4-.5.1-1.3-.6-1.4l-6.3-1.1-1.1-6.3c-.1-.6-.8-.9-1.4-.6L16 5l-5.4-3.7c-.5-.4-1.3-.1-1.4.6l-1 6.3-6.4 1.1c-.6.1-.9.9-.6 1.3L4.9 16l-3.7 5.3c-.4.5-.1 1.3.6 1.4l6.3 1.1 1.1 6.3c.1.6.8.9 1.4.6l5.3-3.7 5.3 3.7c.5.4 1.3.1 1.4-.6l1.1-6.3 6.3-1.1c.8-.1 1.1-.8.7-1.4zM16 25.1c-5.1 0-9.1-4.1-9.1-9.1 0-5.1 4.1-9.1 9.1-9.1s9.1 4.1 9.1 9.1c0 5.1-4 9.1-9.1 9.1z"
50 }
51 className="[transform-origin:center] [transition:transform_var(--toggles-within--duration)_cubic-bezier(0,0,0,1.25)] dark:[transform:scale(0.65)]"
52 />
53 </g>
54 <path
55 d={
56 "M16 7.7c-4.6 0-8.2 3.7-8.2 8.2s3.6 8.4 8.2 8.4 8.2-3.7 8.2-8.2-3.6-8.4-8.2-8.4zm0 14.4c-3.4 0-6.1-2.9-6.1-6.2s2.7-6.1 6.1-6.1c3.4 0 6.1 2.9 6.1 6.2s-2.7 6.1-6.1 6.1z"
57 }
58 className="[transform-origin:center] [transition:transform_var(--toggles-within--duration)_cubic-bezier(0,0,0,1.25)] dark:[transform:scale(1.5)]"
59 />
60 <path
61 d={
62 "M16 9.5c-3.6 0-6.4 2.9-6.4 6.4s2.8 6.5 6.4 6.5 6.4-2.9 6.4-6.4-2.8-6.5-6.4-6.5z"
63 }
64 className="[transform-origin:center] [transition:transform_var(--toggles-within--duration)_cubic-bezier(0,0,0,1.25)] dark:[transform:translate3d(3px,-3px,0)_scale(1.2)]"
65 />
66 </svg>
67// … truncated

Files it writes

  • src/Within.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
yesterday

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