Skip to content

Instantly share code, notes, and snippets.

@paulweezydesign
Last active October 13, 2024 12:24
Show Gist options
  • Save paulweezydesign/97dbf6f9494e13bd558a6c00c8f7babe to your computer and use it in GitHub Desktop.
Save paulweezydesign/97dbf6f9494e13bd558a6c00c8f7babe to your computer and use it in GitHub Desktop.
<button
onClick={toggleTheme}
className="p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 focus:outline-none"
aria-label="Toggle theme"
>
{theme === 'light' ? (
<Moon className="h-5 w-5 text-gray-700 dark:text-gray-300" />
) : (
<Sun className="h-5 w-5 text-gray-700 dark:text-gray-300" />
)}
</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment