Package Exports
- day-night-switch
- day-night-switch/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (day-night-switch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
day-night-switch
一个白天夜晚样式切换的组件,基于react封装。 源码:https://github.com/Xiumuzaidiao/Day-night-toggle-button
demo
![]()
关于
组件源码:https://github.com/PiDazhong/day-night-swicth
props
style className value onChange
使用实例
import React, { useState } from 'react';
import DayNightSwitch from 'day-night-switch';
const myComponent = () => {
const [light, setLight] = useState(true);
return (
<DayNightSwitch
value={light}
onChange={setLight}
style={{
transform: 'scale(0.33)'
}}
className="theme-switch"
/>
)
}