Skip to content

Install Handsontable through your preferred package manager, and control your grid through the HotTable component’s props.

Install Handsontable

To install Handsontable locally using a package manager, run one of these commands:

npm
npm install handsontable @handsontable/vue3
Yarn
yarn add handsontable @handsontable/vue3
pnpm
pnpm add handsontable @handsontable/vue3

Register Handsontable’s modules

Import and register all of Handsontable’s modules with a single function call:

import { registerAllModules } from 'handsontable/registry';
registerAllModules();

Or, to reduce the size of your JavaScript bundle, import only the modules that you need.

Use the HotTable component

The main Handsontable component is called HotTable.

import { HotTable } from '@handsontable/vue3';

To set Handsontable’s configuration options, use HotTable’s props. For example:

<HotTable
:data="data"
:row-headers="true"
:col-headers="true"
height="auto"
:auto-wrap-row="true"
:auto-wrap-col="true"
license-key="non-commercial-and-evaluation"
/>

Preview the result

Vue
<script setup>
import { ref } from 'vue';
import { HotTable } from '@handsontable/vue3';
import { registerAllModules } from 'handsontable/registry';
registerAllModules();
const hotSettings = ref({
data: [
['', 'Tesla', 'Volvo', 'Toyota', 'Ford'],
['2019', 10, 11, 12, 13],
['2020', 20, 11, 14, 13],
['2021', 30, 15, 12, 13],
['2022', 25, 20, 11, 14],
],
rowHeaders: true,
colHeaders: true,
height: 'auto',
autoWrapRow: true,
autoWrapCol: true,
licenseKey: 'non-commercial-and-evaluation',
});
</script>
<template>
<div id="example1">
<HotTable :settings="hotSettings" />
</div>
</template>

Supported versions of Vue

@handsontable/vue3 requires Vue 3. Vue 2 is not supported — use Handsontable 16.2.0 if you need Vue 2.

Handsontable versionVue 3 version
11.0.0 and lowerNo Vue 3 support
11.1.0 and higher3.2.0 and higher

Related guides

Configuration options

Hooks

Result

Handsontable is installed and ready to use in your project. Import it and create your first grid instance.