Skip to content

Commit cc5fce7

Browse files
committed
fix: add aria-label to NavList.Item for improved accessibility
1 parent 74335e4 commit cc5fce7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/table-of-contents.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ const TableOfContentsItems = ({items, depth}) => (
88
<>
99
{items.map(item => (
1010
<React.Fragment key={item.title}>
11-
<NavList.Item href={item.url} sx={{pl: depth > 1 ? 4 : 2}}>
11+
<NavList.Item
12+
href={item.url}
13+
sx={{pl: depth > 1 ? 4 : 2}}
14+
aria-label={`${item.title}${depth > 1 ? ` in ${item.title}` : ''} 10 of 200`}
15+
>
1216
{item.title}
1317
</NavList.Item>
1418
{item.items ? <TableOfContentsItems items={item.items} depth={depth + 1} /> : null}

0 commit comments

Comments
 (0)