Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Demonstrates an Ionic Vue counter with dark/light theme toggle.
<template>
<ion-app :class="isDark ? 'dark-theme' : 'light-theme'">
<ion-header>
<ion-toolbar>
<ion-title>Dark Mode Counter</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding" style="text-align:center">
<h2>Counter: {{ count }}</h2>
<ion-button @click="count++">+</ion-button>
<ion-button @click="count--">-</ion-button>
<ion-button @click="count=0">Reset</ion-button>
<br/><br/>
<ion-button @click="toggleTheme">Switch Theme</ion-button>
</ion-content>
</ion-app>
</template>
<script>
import { ref } from 'vue';
export default {
setup() {
const count = ref(0);
const isDark = ref(false);
const toggleTheme = () => { isDark.value = !isDark.value };
return { count, isDark, toggleTheme };
}
}
</script>Ionic Framework is an open-source UI toolkit for building high-quality, cross-platform mobile, desktop, and web apps using web technologies like HTML, CSS, and JavaScript, often paired with Angular, React, or Vue.
Origin & Creator
Created by Max Lynch, Ben Sperry, and Adam Bradley of Drifty Co. in 2013 to simplify hybrid mobile app development.
Industrial Note
Ionic is widely used in enterprise mobile apps, PWAs, and hybrid apps that need native-like performance across multiple platforms.