# restricted-component-names

Rule `vue/restricted-component-names`. Enforce using only specific component names

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/restricted-component-names` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/restricted-component-names.html) |

## Code examples

### Incorrect: the rule reports this

```vue
  <custom-component />
</template>
```

```vue
  <my-component />
</template>
```

### Correct: the rule accepts this

```vue
<button/>
<keep-alive></keep-alive>
```

```vue
<custom-component />
```

Examples from the ESLint documentation.

## Enable it

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

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/restricted-component-names": "error",
    },
  },
];
```

## Related rules

- [vue/require-prop-comment](https://lintradar.dev/rules/vue/require-prop-comment.md): Require props to have a comment
- [vue/script-indent](https://lintradar.dev/rules/vue/script-indent.md): Enforce consistent indentation in `<script>`
- [vue/require-name-property](https://lintradar.dev/rules/vue/require-name-property.md): Require a name property in Vue components
- [vue/sort-keys](https://lintradar.dev/rules/vue/sort-keys.md): Enforce sort-keys in a manner that is compatible with order-in-components
- [vue/require-expose](https://lintradar.dev/rules/vue/require-expose.md): Require declare public properties using `expose`
- [vue/static-class-names-order](https://lintradar.dev/rules/vue/static-class-names-order.md): Enforce static class names order

---

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