diff --git a/src/guide/best-practices/accessibility.md b/src/guide/best-practices/accessibility.md index 2651f2d0b8..c7df07948a 100644 --- a/src/guide/best-practices/accessibility.md +++ b/src/guide/best-practices/accessibility.md @@ -229,6 +229,38 @@ Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibi ![Chrome Developer Tools showing input accessible name from aria-labelledby](./images/AccessibleARIAlabelledbyDevTools.png) +:::tip Using `aria-labelledby` in reusable components +When using `aria-labelledby` inside a Vue component that may be rendered multiple times on the same page, static `id` values will conflict. Use Vue's [`useId`](/api/composition-api-helpers.html#useid) helper to generate unique IDs that are stable across server and client rendering: + +```vue + + + +``` + +This ensures each component instance gets unique IDs, preventing collisions when the same component is used multiple times on a page. +::: + #### `aria-describedby` {#aria-describedby} [aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used the same way as `aria-labelledby` except provides a description with additional information that the user might need. This can be used to describe the criteria for any input: