# no-static-element-interactions

Rule `jsx-a11y/no-static-element-interactions`. Enforce that non-interactive, visible elements (such as `<div>`) that have click handlers use the role attribute.

- Source: jsx-a11y
- Technologies: Accessibility, React
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 99M weekly downloads of presets that enable it
- Trend: +55.4% last quarter
- Rank: #182 by reach, #739 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jsx-a11y/no-static-element-interactions` | yes | no | package `eslint-plugin-jsx-a11y` | [docs](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/no-static-element-interactions.md) |
| Oxlint | `jsx-a11y/no-static-element-interactions` | no | no | plugin `jsx-a11y`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/no-static-element-interactions.html) |
| Biome | `a11y/noStaticElementInteractions` | yes | no | group a11y, since 1.9.0 | [docs](https://biomejs.dev/linter/rules/no-static-element-interactions/) |

## Code examples

### Incorrect: the rule reports this

```jsx
<div onClick={() => {}} />
```

### Correct: the rule accepts this

```jsx
<button onClick={() => {}} className="foo" />
<div className="foo" onClick={() => {}} role="button" />
<input type="text" onClick={() => {}} />
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import jsxA11y from "eslint-plugin-jsx-a11y";

export default [
  {
    plugins: { "jsx-a11y": jsxA11y },
    rules: {
      "jsx-a11y/no-static-element-interactions": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jsx-a11y"
  ],
  "rules": {
    "jsx-a11y/no-static-element-interactions": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "a11y": {
        "noStaticElementInteractions": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [jsx-a11y recommended](https://lintradar.dev/presets/jsx-a11y-recommended.md) | ESLint | `eslint-plugin-jsx-a11y` | 31 | 65.1M | +42.0% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [jsx-a11y strict](https://lintradar.dev/presets/jsx-a11y-strict.md) | ESLint | `eslint-plugin-jsx-a11y` | 31 | 65.1M | +42.0% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [jsx-a11y/no-noninteractive-tabindex](https://lintradar.dev/rules/jsx-a11y/no-noninteractive-tabindex.md): `tabIndex` should only be declared on interactive elements.
- [jsx-a11y/tabindex-no-positive](https://lintradar.dev/rules/jsx-a11y/tabindex-no-positive.md): Enforce `tabIndex` value is not greater than zero.
- [jsx-a11y/no-noninteractive-element-to-interactive-role](https://lintradar.dev/rules/jsx-a11y/no-noninteractive-element-to-interactive-role.md): Non-interactive elements should not be assigned interactive roles.
- [jsx-a11y/no-interactive-element-to-noninteractive-role](https://lintradar.dev/rules/jsx-a11y/no-interactive-element-to-noninteractive-role.md): Interactive elements should not be assigned non-interactive roles.
- [jsx-a11y/mouse-events-have-key-events](https://lintradar.dev/rules/jsx-a11y/mouse-events-have-key-events.md): Enforce that `onMouseOver`/`onMouseOut` are accompanied by `onFocus`/`onBlur` for keyboard-only users.
- [jsx-a11y/media-has-caption](https://lintradar.dev/rules/jsx-a11y/media-has-caption.md): Enforces that `<audio>` and `<video>` elements must have a `<track>` for captions.

---

Web page: https://lintradar.dev/rules/jsx-a11y/no-static-element-interactions. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
