Skip to content

Installation

Install Handsontable DataGrid through your preferred package manager, and control your grid through the HotTableComponent props.

Prerequisites

  • Node.js version 18 or newer
  • Angular CLI version 16 or newer: npm install -g @angular/cli

Install Handsontable

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

npm
npm install handsontable @handsontable/angular-wrapper
Yarn
yarn add handsontable @handsontable/angular-wrapper
pnpm
pnpm add handsontable @handsontable/angular-wrapper

Install Skills for Claude Code

Skills for Claude Code give Claude AI deep knowledge of Handsontable’s APIs, so it can build, configure, and debug your grid accurately. We recommend installing them alongside Handsontable.

In Claude Code, run:

Terminal window
/plugin marketplace add handsontable/handsontable-skills
/plugin install handsontable-skills@handsontable-skills

For more details, see Skills for Claude Code.

Configure app.config.ts

In app.config.ts, register Handsontable’s modules and set global configuration values via the HOT_GLOBAL_CONFIG token. You can modify these values at any time using HotGlobalConfigService, or override them per table. All properties of HotGlobalConfig are optional.

import { ApplicationConfig, provideZoneChangeDetection } from "@angular/core";
import {
HOT_GLOBAL_CONFIG,
HotGlobalConfig,
} from "@handsontable/angular-wrapper";
import { registerAllModules } from "handsontable/registry";
import { registerLanguageDictionary, enUS } from "handsontable/i18n";
registerAllModules();
registerLanguageDictionary(enUS);
const globalHotConfig: HotGlobalConfig = {
// license: 'your-license-key', // get a key at https://handsontable.com/pricing/
layoutDirection: "ltr",
language: enUS.languageCode,
};
export const appConfig: ApplicationConfig = {
providers: [
provideZoneChangeDetection({ eventCoalescing: true }),
{ provide: HOT_GLOBAL_CONFIG, useValue: globalHotConfig },
],
};

To reduce the size of your JavaScript bundle, import only the modules that you need instead of calling registerAllModules().

Use the HotTable component

The main Handsontable component is called HotTableComponent. Import HotTableModule in your component and pass configuration via a GridSettings object:

import { Component } from "@angular/core";
import {
GridSettings,
HotTableModule,
} from "@handsontable/angular-wrapper";
@Component({
standalone: true,
imports: [HotTableModule],
template: ` <div>
<hot-table [data]="data" [settings]="gridSettings"></hot-table>
</div>`,
})
export class HotTableWrapperComponent {
readonly data = [
["SKU-4821", "Stainless Steel Water Bottle", "Harbor Goods", "Drinkware", "Seattle"],
["SKU-0093", "Wireless Mouse", "Alpine Supply Co.", "Electronics", "Denver"],
["SKU-1170", "Ergonomic Office Chair", "Cascade Distributors", "Furniture", "Portland"],
["SKU-2208", "USB-C Charging Cable", "Summit Trading", "Electronics", "Austin"],
["SKU-3341", "Aluminum Water Filter", "Northgate Wholesale", "Drinkware", "Minneapolis"],
];
readonly gridSettings: GridSettings = {
rowHeaders: true,
colHeaders: ["SKU", "Product", "Supplier", "Category", "Warehouse"],
height: "auto",
autoWrapRow: true,
autoWrapCol: true,
};
}

Preview the result

TypeScript
/* file: app.component.ts */
import { Component } from '@angular/core';
import { GridSettings, HotTableModule} from '@handsontable/angular-wrapper';
@Component({
selector: 'example-installation',
standalone: true,
imports: [HotTableModule],
template: `<div>
<hot-table [data]="data" [settings]="gridSettings"></hot-table>
</div>`,
})
export class AppComponent {
readonly data = [
['SKU-4821', 'Stainless Steel Water Bottle', 'Harbor Goods', 'Drinkware', 'Seattle'],
['SKU-0093', 'Wireless Mouse', 'Alpine Supply Co.', 'Electronics', 'Denver'],
['SKU-1170', 'Ergonomic Office Chair', 'Cascade Distributors', 'Furniture', 'Portland'],
['SKU-2208', 'USB-C Charging Cable', 'Summit Trading', 'Electronics', 'Austin'],
['SKU-3341', 'Aluminum Water Filter', 'Northgate Wholesale', 'Drinkware', 'Minneapolis'],
];
readonly gridSettings: GridSettings = {
rowHeaders: true,
colHeaders: ['SKU', 'Product', 'Supplier', 'Category', 'Warehouse'],
height: 'auto',
autoWrapRow: true,
autoWrapCol: true,
};
}
/* end-file */
/* file: app.config.ts */
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { registerAllModules } from 'handsontable/registry';
import { HOT_GLOBAL_CONFIG, HotGlobalConfig } from '@handsontable/angular-wrapper';
import { registerLanguageDictionary, enUS } from "handsontable/i18n";
registerLanguageDictionary(enUS);
registerAllModules();
const globalHotConfig: HotGlobalConfig = {
// license: 'your-license-key', // get a key at https://handsontable.com/pricing/
layoutDirection: "ltr",
language: enUS.languageCode,
};
export const appConfig: ApplicationConfig = {
providers: [
provideZoneChangeDetection({ eventCoalescing: true }),
{ provide: HOT_GLOBAL_CONFIG, useValue: globalHotConfig },
],
};
/* end-file */
HTML
<div>
<example-installation></example-installation>
</div>

Supported versions of Angular

@handsontable/angular-wrapper requires at least Angular 16. If you use a lower version of Angular, you can use the @handsontable/angular package instead.

For more information on @handsontable/angular, see the 15.3 documentation.

Angular versionHandsontable wrapper
Older than 16@handsontable/angular (deprecated)
16 and newer@handsontable/angular-wrapper

Troubleshooting

If you’re using Angular 21 or newer, please note that older versions of @handsontable/angular-wrapper are incompatible due to recent breaking changes in Angular. To ensure smooth integration, upgrade to @handsontable/angular-wrapper@16.2 or later.

Server-side rendering (SSR)

You can include <hot-table> in a template that Angular renders on the server, and the server render doesn’t throw. On the server, HotTableComponent doesn’t create a grid, so hotInstance stays null and the server HTML contains no Handsontable grid. In the browser, the component creates the grid in ngAfterViewInit.

While Angular’s event dispatch contract is active, stopImmediatePropagation() inside a Handsontable hook does not stop Handsontable listeners above body. A shortcut or a selection can still run. The contract is active before ApplicationRef.whenStable(). With withIncrementalHydration(), it stays active for the whole app lifetime. Return false from beforeKeyDown to block the key.

Result

Handsontable is installed and running in your Angular application. You can now configure options or import only the modules you need to reduce your bundle size.

Result

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

Related guides

Configuration options

Hooks