MCPcopy Create free account
hub / github.com/amaancoderx/skillui / ThemeToggle

Function ThemeToggle

components/ThemeToggle.tsx:29–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29export default function ThemeToggle() {
30 const { theme, toggle } = useTheme()
31
32 return (
33 <button
34 onClick={toggle}
35 className="flex items-center justify-center w-8 h-8 rounded-md border border-[#e5e5e5] dark:border-[#1a1a1a] text-[#888] dark:text-[#555] hover:text-[#111] dark:hover:text-[#aaa] hover:border-[#ccc] dark:hover:border-[#333] bg-transparent transition-all duration-150"
36 aria-label={theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'}
37 >
38 {theme === 'dark' ? <SunIcon /> : <MoonIcon />}
39 </button>
40 )
41}

Callers

nothing calls this directly

Calls 1

useThemeFunction · 0.90

Tested by

no test coverage detected