Skip to content

Commit d4e234f

Browse files
Update NavList to use the new GroupHeading API and add an as prop to specify the heading level (h3 to match with the default) (#4593)
* Add the default heading level with the as prop for NAvlist.Group * Create calm-insects-boil.md * update the comment
1 parent c81898c commit d4e234f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/calm-insects-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Update NavList to use the new ActionList.GroupHeading API and Add an "as" prop to specify the heading level as default h3. (No changes expected in the rendered HTML)

packages/react/src/NavList/NavList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ const Group: React.FC<NavListGroupProps> = ({title, children, sx: sxProp = defau
259259
<>
260260
{/* Hide divider if the group is the first item in the list */}
261261
<ActionList.Divider sx={{'&:first-child': {display: 'none'}}} />
262-
<ActionList.Group {...props} title={title} sx={sxProp}>
262+
<ActionList.Group {...props} sx={sxProp}>
263+
{/* Setting up the default value for the heading level. TODO: API update to give flexibility to NavList.Group title's heading level */}
264+
<ActionList.GroupHeading as="h3">{title}</ActionList.GroupHeading>
263265
{children}
264266
</ActionList.Group>
265267
</>

0 commit comments

Comments
 (0)