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/half-sun

Half Sun Theme Toggle

animated-theme-toggles/half-sun
FreeBlock

Animated Theme Toggles publishes no description for this item.

Install it

npx shadcn@latest add https://toggles.dev/r/half-sun.json

Source

src/HalfSun.tsxtoggles.dev/r/half-sun.json
1import { type ButtonHTMLAttributes, type CSSProperties } from "react";
2
3export interface HalfSunProps extends Omit<
4 ButtonHTMLAttributes<HTMLButtonElement>,
5 "children"
6> {
7 duration?: number;
8 [key: `data-${string}`]: string | number | boolean | null | undefined;
9}
10
11export function HalfSun({
12 duration = 500,
13 className,
14 type = "button",
15 title = "Toggle theme",
16 "aria-label": ariaLabel = "Toggle theme",
17 ...props
18}: HalfSunProps) {
19 return (
20 <button
21 type={type}
22 title={title}
23 aria-label={ariaLabel}
24 className={className}
25 {...props}
26 >
27 <svg
28 width="1em"
29 height="1em"
30 viewBox="0 0 32 32"
31 aria-hidden="true"
32 fill={"currentColor"}
33 style={
34 { "--toggles-half-sun--duration": `${duration}ms` } as CSSProperties
35 }
36 >
37 <path
38 d={
39 "M27.5 11.5v-7h-7L16 0l-4.5 4.5h-7v7L0 16l4.5 4.5v7h7L16 32l4.5-4.5h7v-7L32 16l-4.5-4.5zM16 25.4V6.6c5.2 0 9.4 4.2 9.4 9.4s-4.2 9.4-9.4 9.4z"
40 }
41 className="origin-center transition-transform duration-(--toggles-half-sun--duration) [transition-timing-function:ease] dark:rotate-180"
42 />
43 </svg>
44 </button>
45 );
46}

Files it writes

  • src/HalfSun.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
Horizon Theme TogglehorizonAnimated Theme TogglesBlocksFreeno deps
Inner Moon Theme Toggleinner-moonAnimated 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