文件名称:react-toggle-dark-mode:React用于React的时尚暗模式切换按钮
文件大小:1.07MB
文件格式:ZIP
更新时间:2024-05-22 02:51:29
TypeScript
React切换暗模式 :night_with_stars: 在博客中看到的动画暗模式切换! 先决条件 节点> = 10 安装 npm i react-toggle-dark-mode 或使用Yarn: yarn add react-toggle-dark-mode 用法 import * as React from 'react' ; import * as ReactDOM from 'react-dom' ; import { DarkModeSwitch } from 'react-toggle-dark-mode' ; const App = ( ) => { const [ isDarkMode , setDarkMode ] = React . useState ( false ) ; const toggleDarkMode = ( checked : boolean ) => { se
【文件预览】:
react-toggle-dark-mode-master
----example()
--------package.json(571B)
--------index.html(362B)
--------.npmignore(24B)
--------tsconfig.json(458B)
--------index.tsx(2KB)
--------yarn.lock(228KB)
----docs()
--------demo.gif(919KB)
----package.json(1KB)
----.github()
--------workflows()
----test()
--------index.test.tsx(384B)
----LICENSE(1KB)
----src()
--------index.tsx(3KB)
----tsconfig.json(528B)
----.gitignore(41B)
----README.md(4KB)
----yarn.lock(265KB)