# useUniqueElementIds

Rule `biome/useUniqueElementIds`. Disallow static `id` values on elements outside SVG contexts.

- Source: biome
- Technologies: React
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1971 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/useUniqueElementIds` | no | no | group correctness, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/use-unique-element-ids/) |

## Code examples

### Incorrect: the rule reports this

```jsx
<div id="foo">bar</div>;
```

```jsx
React.createElement("div", { id: "foo" });
```

### Correct: the rule accepts this

```jsx
const id = useId();
<div id={id}>bar</div>;
```

```jsx
const id = useId();
React.createElement("div", { id });
```

```jsx
<svg>
    <defs>
        <pattern id="dots" width="10" height="10" />
    </defs>
    <rect fill="url(#dots)" width="100%" height="100%" />
</svg>
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "useUniqueElementIds": "error"
      }
    }
  }
}
```

## Related rules

- [biome/useTailwindStaticClassStrings](https://lintradar.dev/rules/biome/useTailwindStaticClassStrings.md): Require complete, statically written class names.
- [biome/useVueVapor](https://lintradar.dev/rules/biome/useVueVapor.md): Enforce opting in to Vue Vapor mode in `<script setup>` blocks.
- [biome/useTailwindShorthandClasses](https://lintradar.dev/rules/biome/useTailwindShorthandClasses.md): Enforce using fewer Tailwind utilities instead of multiple utilities that are functionally the same.
- [biome/useSvelteStoreInitialValue](https://lintradar.dev/rules/biome/useSvelteStoreInitialValue.md): Require Svelte stores to be created with an initial value.
- [biome/useSolidForComponent](https://lintradar.dev/rules/biome/useSolidForComponent.md): Enforce using Solid's `<For />` component for mapping an array to JSX elements.
- [biome/useReactNamingConvention](https://lintradar.dev/rules/biome/useReactNamingConvention.md): Enforces naming conventions for React `createContext`, `useId`, and `useRef`.

---

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