# alt-text

Rule `jsx-a11y/alt-text`. Enforce all elements that require alternative text have meaningful information to relay back to end user.

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```jsx
function Foo(props) {
  return <img {...props} />
}
```

```jsx
<img src="foo" />
<img {...props} />
<img {...props} alt /> // Has no value
<img {...props} alt={undefined} /> // Has no value
<img {...props} alt={`${undefined}`} /> // Has no value
<img src="foo" role="presentation" /> // Avoid ARIA if it can be achieved without

<img src="foo" role="none" /> // Avoid ARIA if it can be achieved without

<object {...props} />


<area {...props} />

<input type="image" {...props} />
```

### Correct: the rule accepts this

```jsx
function Foo({ alt, ...props}) {
    return <img alt={alt} {...props} />
}

// OR

function Foo(props) {
    const {
        alt,

        ...otherProps
    } = props;

   return <img alt={alt} {...otherProps} />
}
```

```jsx
<img src="foo" alt="Foo eating a sandwich." />
<img src="foo" alt={"Foo eating a sandwich."} />
<img src="foo" alt={altText} />
<img src="foo" alt={`${person} smiling`} />
<img src="foo" alt="" />

<object aria-label="foo" />
<object aria-labelledby="id1" />
<object>Meaningful description</object>
<object title="An object" />

<area aria-label="foo" />
<area aria-labelledby="id1" />

<area alt="This is descriptive!" />

<input type="image" alt="This is descriptive!" />
<input type="image" aria-label="foo" />
<input type="image" aria-labelledby="id1" />
```

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/alt-text": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jsx-a11y"
  ],
  "rules": {
    "jsx-a11y/alt-text": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "a11y": {
        "useAltText": "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% |
| [Next.js Core Web Vitals](https://lintradar.dev/presets/next-core-web-vitals.md) | ESLint | `eslint-config-next` | 62 | 46.8M | +48.8% |
| [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% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [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/aria-props](https://lintradar.dev/rules/jsx-a11y/aria-props.md): Enforce all `aria-*` props are valid.
- [jsx-a11y/aria-proptypes](https://lintradar.dev/rules/jsx-a11y/aria-proptypes.md): Enforce ARIA state and property values are valid.
- [jsx-a11y/aria-unsupported-elements](https://lintradar.dev/rules/jsx-a11y/aria-unsupported-elements.md): Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.
- [jsx-a11y/role-has-required-aria-props](https://lintradar.dev/rules/jsx-a11y/role-has-required-aria-props.md): Enforce that elements with ARIA roles must have all required attributes for that role.
- [jsx-a11y/role-supports-aria-props](https://lintradar.dev/rules/jsx-a11y/role-supports-aria-props.md): Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`.
- [jsx-a11y/anchor-has-content](https://lintradar.dev/rules/jsx-a11y/anchor-has-content.md): Enforce all anchors to contain accessible content.

---

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