MCPcopy Create free account
hub / github.com/chakra-ui/panda / ThemeSwitchButton

Function ThemeSwitchButton

website/src/components/theme-switch-button.tsx:41–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39})
40
41export function ThemeSwitchButton() {
42 const { iconToUse, toggleTheme, mounted, iconText } = useThemeSwitch()
43
44 return (
45 <button
46 style={{ opacity: mounted ? 1 : 0 }}
47 onClick={toggleTheme}
48 className={switchStyle}
49 >
50 <HStack gap="2">
51 <span>{iconText} </span>
52 <ButtonIcon icon={iconToUse} />
53 </HStack>
54 </button>
55 )
56}
57
58export function ThemeSwitchIconButton() {
59 const { iconToUse, iconText, toggleTheme, mounted } = useThemeSwitch()

Callers

nothing calls this directly

Calls 1

useThemeSwitchFunction · 0.85

Tested by

no test coverage detected