this is the @magic-modules LightSwitch component. It provides a dynamic dark/light mode switch button
npm install --save-exact @magic-modules/light-switch
// in any component View
export const View = state => [LightSwitch(state)]
thats it, your magic app now knows displays a LightSwitch in the top right.
to position LightSwitch in another corner,
simply pass left
and/or bottom
as part of the props:
export const View = state => [LightSwitch({ ...state, left: true, bottom: true })]
first commit
use @magic npm packages instead of github for installs
default colors are adapted for @magic-themes/docs
- require node 13.5.0
- use svg graphic instead of a dot
- update svg
bump required node version to 14.2.0
add icon css class to svg
set default height and width in svg only
- fix positioning
- remove button container
- simplify css
bump required node version to 14.15.4
update dependencies
update dependencies
...