---
url: https://akinozgen.github.io/datagrids/errors/DG002.md
description: >-
  One datagrids warning or error code — the message, when it happens and how to
  fix it.
---

# DG002: Grid has no accessible name

```text
[datagrids DG002] Grid has no accessible name; pass `label` or `labelledBy`.
```

Printed with `console.warn`, once per distinct message. `configure({ warnings: false })` silences it.

## When it happens

The grid was created without `label`, `labelledBy` or `title`, and the table has no `<caption>`.
Assistive technology then announces the scroll region with the generic `messages.regionLabel`
("Data table"), the same name for every grid on the page.

## How to fix it

Name every grid after what it lists:

```js
new Datagrid("#agents", { label: "Field agents", columns });
```

Or point at a visible heading with `labelledBy: "agents-heading"`, or keep a `<caption>` in the table.
`title` names the grid only together with `surface: "card"`; `label` works everywhere.
See [Accessibility](/guide/accessibility).

## Related

* [All warning codes](/errors/)
* [Grid options](/reference/options)
* [Static API & configure()](/reference/static)
