# vue-dark-mode-switch

> vue-dark-mode-switch is a beautiful switch for dark mode theme switching.

Latest version **1.1.0** (published 2021-04-10) · Under WTFPL licence license · 0 weekly downloads

## Install

```sh
npm install vue-dark-mode-switch
pnpm add vue-dark-mode-switch
yarn add vue-dark-mode-switch
bun add vue-dark-mode-switch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-04-10 |
| First published | 2020-06-14 |
| Weekly downloads | 0 |
| License | Under WTFPL licence |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 592.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ismaïl NGUYEN |
| Maintainers | ismailnguyen |

## Links

- npm: https://www.npmjs.com/package/vue-dark-mode-switch
- Repository: https://github.com/ismailnguyen/vue-dark-mode-switch
- Homepage: https://github.com/ismailnguyen/vue-dark-mode-switch#readme
- Issues: https://github.com/ismailnguyen/vue-dark-mode-switch/issues
- npm.io page: https://npm.io/package/vue-dark-mode-switch

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Recent versions

- 1.1.0 (latest) — 2021-04-10
- 1.0.7 — 2021-03-04
- 1.0.6 — 2020-06-14
- 1.0.5 — 2020-06-14
- 1.0.4 — 2020-06-14
- 1.0.3 — 2020-06-14
- 1.0.2 — 2020-06-14
- 1.0.1 — 2020-06-14
- 1.0.0 — 2020-06-14

## README

# vue-dark-mode-switch
VueJS Dark mode switch component

## Install
```shell
npm install --save vue-dark-mode-switch
```

## Usage
Import the `DarkModeSwitch` component, and it will emit its state through `@switched` event method.
`initalState` props allow to initialize the switch value (optional, default value is false).

```html
<template>
    <DarkModeSwitch @switched="onSwitched" :initialState="isDarkModeEnabled" />
</template>

<script>
	import DarkModeSwitch from 'vue-dark-mode-switch'
    import 'vue-dark-mode-switch/dist/vue-dark-mode-switch.css'

	export default {
		data () {
            return {
                isDarkModeEnabled: true
            }
        },
		components: {
			DarkModeSwitch
		},
		methods: {
			onSwitched: function (isSwitched) {
				console.log('dark mode is enabled :', isSwitched);
			}
		}
	}
</script>
```

## Demo

Live : [https://www.ismailnguyen.com](https://www.ismailnguyen.com)

### Switch Off
![Switch Off](https://raw.githubusercontent.com/ismailnguyen/vue-dark-mode-switch/master/docs/assets/switch_off.png)

### Switch On
![Switch On](https://raw.githubusercontent.com/ismailnguyen/vue-dark-mode-switch/master/docs/assets/switch_on.png)

---
_Source: https://npm.io/package/vue-dark-mode-switch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
