暗黑模式图标之间的动画切换

82 阅读1分钟

'use client'

import { useDark } from 'jotai-dark/react'

export function AppearanceSwitch({ className = '' }: { className?: string }) { const { toggleDark } = useDark({ disableTransition: true, disableTransitionExclude: ['.i-lucide-sun', '.i-lucide-moon'], })

return ( <button type="button" onClick={toggleDark} className={flex ${className}}>

Toggle theme ) }

来源 githug