You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The component uses the semantic <nav> tag along with an explicit role="navigation" attribute.
As far as I’ve learned, HTML5 semantic elements like <nav> already imply the corresponding ARIA role.
I'm curious why both are used together in this case.
Is there a specific reason for explicitly declaring the role, or is it just for clarity or broader accessibility support?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm a web developer currently studying in South Korea.
I was looking at the pagination component in the shadcn/ui repo, and I noticed that in the following line:
ui/apps/www/registry/default/ui/pagination.tsx
Line 9 in 84d6c83
The component uses the semantic <nav> tag along with an explicit role="navigation" attribute.
As far as I’ve learned, HTML5 semantic elements like <nav> already imply the corresponding ARIA role.
I'm curious why both are used together in this case.
Is there a specific reason for explicitly declaring the role, or is it just for clarity or broader accessibility support?
Thank you in advance for your answer!
Beta Was this translation helpful? Give feedback.
All reactions