Skip to content

Commit 12fad7a

Browse files
chore: fix UnderlineWrapper html structure (#7097)
1 parent 996847d commit 12fad7a

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

.changeset/quiet-terms-juggle.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+
chore: fix UnderlineWrapper html structure

packages/react/src/experimental/UnderlinePanels/UnderlinePanels.docs.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@
5858
"type": "boolean",
5959
"defaultValue": "false",
6060
"description": "Loading state for all counters. It displays loading animation for individual counters until all are resolved. It is needed to prevent multiple layout shift."
61+
},
62+
{
63+
"name": "as",
64+
"type": "React.ElementType",
65+
"defaultValue": "'div'",
66+
"description": "The HTML element or React component used to render the outermost element."
6167
}
6268
],
6369
"subcomponents": [

packages/react/src/experimental/UnderlinePanels/UnderlinePanels.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export type UnderlinePanelsProps = {
5252
* Class name for custom styling
5353
*/
5454
className?: string
55+
/**
56+
* Element type for the tab container
57+
*/
58+
as?: React.ElementType
5559
}
5660

5761
export type TabProps = PropsWithChildren<{

packages/react/src/internal/components/UnderlineTabbedInterface.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type UnderlineWrapperProps<As extends React.ElementType> = {
2121
}
2222

2323
export const UnderlineWrapper = forwardRef((props, ref) => {
24-
const {children, className, as: Component = 'nav', ...rest} = props
24+
const {children, className, as: Component = 'div', ...rest} = props
2525
return (
2626
<Component
2727
className={clsx(classes.UnderlineWrapper, className)}

0 commit comments

Comments
 (0)