Vue UI Components Documentation
This tutorial creates a Vue 3.5 and TypeScript project and adds a jQWidgets Vue component to it. You will end with a Bar Gauge whose values change when you click a button.
Earlier versions of this page used Vue CLI. Vue CLI is in maintenance mode and the Vue team recommends create-vue instead: it scaffolds a Vite project, which starts in well under a second and needs no webpack configuration.
Install Node.js 22 LTS or later. Check the version with node -v.
Run create-vue. It asks which features to add; answer Yes to TypeScript. Then install jQWidgets:
npm create vue@latest my-app
cd my-app
npm install
npm install jqwidgets-scripts
The jqwidgets-scripts package contains the JavaScript library, the themes (jqwidgets/styles) and the Vue 3 components (jqwidgets-vue3).
Add one setting to vite.config.ts, so that npm run build does not stop with Unexpected token Semicolon: some jQWidgets themes still contain Internet Explorer CSS hacks (*zoom: 1), which Vite's CSS minifier rejects, and errorRecovery drops those lines instead of stopping the build. Keep the rest of the file create-vue wrote:
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
// Some jQWidgets themes still contain Internet Explorer CSS hacks (*zoom: 1), which Vite's
// CSS minifier rejects: errorRecovery drops those lines instead of stopping the build.
css: { lightningcss: { errorRecovery: true } },
})
An app that also uses the Grid, Calendar, DateTimeInput, Form or Scheduler needs one more addition for npm run dev, shown in Add a Grid to a Vue 3 app.
With Vue CLI you had to copy the styles folder to public/ and link it from index.html. Vite bundles CSS imports, including the images and fonts they reference, so you import the files instead. Replace src/main.ts:
import { createApp } from 'vue';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.tailwind-blue-dark.css';
import App from './App.vue';
createApp(App).mount('#app');
The Vue components are plain JavaScript files, so TypeScript's strict mode rejects importing them (TS7016: Could not find a declaration file). Declare them once in a new file, src/jqwidgets-vue3.d.ts:
// src/jqwidgets-vue3.d.ts
declare module 'jqwidgets-scripts/jqwidgets-vue3/*.vue' {
import type { DefineComponent } from 'vue';
const component: DefineComponent<Record<string, any>, Record<string, any>, any>;
export default component;
}
Replace src/App.vue. <script setup> makes everything declared in the script available to the template, so there is no components, data or methods object:
<script setup lang="ts">
import { ref } from 'vue';
import JqxBarGauge from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxbargauge.vue';
const values = ref([10, 20, 30, 40, 50]);
// Called for every bar; it returns the bar's color. Values above 80 turn red.
const formatFunction = (value: number, _index: number, color: string) => (value > 80 ? '#d32f2f' : color);
function randomize() {
values.value = values.value.map(() => Math.round(Math.random() * 100));
}
</script>
<template>
<main>
<JqxBarGauge theme="tailwind-blue-dark" :width="600" :height="600" :values="values" :formatFunction="formatFunction" />
<button type="button" @click="randomize">New values</button>
</main>
</template>
When values changes, the component passes the new array to the widget, which animates to it.
npm run dev
Open http://localhost:5173. The page updates as you save files.

npm run build
npm run preview
npm run build type-checks the project with vue-tsc and writes the production files to dist/. npm run preview serves that folder so you can check it before you deploy.
| Vue CLI | create-vue (Vite) |
|---|---|
npm run serve on port 8080 | npm run dev on port 5173 |
public/index.html | index.html in the project root, loading /src/main.ts |
vue.config.js | vite.config.ts |
VUE_APP_* variables in process.env | VITE_* variables in import.meta.env |
Vue 2 components from jqwidgets-vue | Vue 3 components from jqwidgets-scripts/jqwidgets-vue3 |
v-modelLive examples of every Vue component: jqwidgets.com/vue.