Skip to content

motion

One switch for every movement of the grid: a setting of your own « reduce motion », or a calm screen.

Typeboolean
Defaulttrue
Live update (update())Yes
Angularthe [motion] input
<dz-grid>the motion attribute
Declared inpackages/dom/src/settings.ts

false stops every movement: the theme’s transitions (a row’s hover colour, a toggle turning, the busy bar’s sliding segment), and the animations of @dzgrid/dom/motion-gsap (rows gliding to their new place, a value’s flash, popups fading in). The grid’s root says data-motion="off", for your own CSS to follow. true again brings them back.

The reader’s system wins too: with « reduce motion » on (prefers-reduced-motion: reduce), the grid moves as little whatever motion says. motion: false is for an application that offers the choice itself, or a screen that must stay still — a wall display, a screenshot.

import { createGrid } from '@dzgrid/dom';
import { EN } from '@dzgrid/dom/locales/en';
type Lamp = { id: string; street: string; watts: number };
const grid = createGrid<Lamp>(document.getElementById('lamps')!, {
rows: [{ id: 'l1', street: 'Mill Lane', watts: 40 }],
columns: [{ id: 'street', header: 'Street' }, { id: 'watts', header: 'Watts', type: 'number' }],
getRowId: (l) => l.id,
messages: EN,
motion: false,
});
grid.update({ motion: true });