react-icons/hi#HiMoon TypeScript Examples
The following examples show how to use
react-icons/hi#HiMoon.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DarkModeSwitch.tsx From ksana.in with Apache License 2.0 | 6 votes |
export function DarkModeSwitch() {
const { colorMode, toggleColorMode } = useColorMode()
const isDark: string | boolean = colorMode === 'dark'
return (
<IconButton
aria-label="Theme switcher"
onClick={toggleColorMode}
fontSize="20px"
borderRadius="md"
bgColor="orange.300"
_hover={{
bg: 'orange.500'
}}
icon={isDark ? <HiSun color="white" /> : <HiMoon color="white" />}
/>
)
}