Skip to content

Commit a9fab98

Browse files
Princeyadav05Prince Yadavbroccolinisoup
authored
feat: added support for className to <AnchoredOverlay> (#4741)
* feat: added support for className to <AnchoredOverlay> * feat: add support for className to <AnchoredOverlay> * add changeset --------- Co-authored-by: Prince Yadav <[email protected]> Co-authored-by: Armağan <[email protected]>
1 parent 1c131f8 commit a9fab98

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.changeset/sixty-trains-flow.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+
AnchoredOverlay: Add 'className' prop to the component

packages/react/src/AnchoredOverlay/AnchoredOverlay.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ interface AnchoredOverlayBaseProps extends Pick<OverlayProps, 'height' | 'width'
7979
* Settings to apply to the Focus Zone on the internal `Overlay` component.
8080
*/
8181
focusZoneSettings?: Partial<FocusZoneHookSettings>
82+
83+
/**
84+
* Optional className to be added to the overlay component.
85+
*/
86+
className?: string
8287
}
8388

8489
export type AnchoredOverlayProps = AnchoredOverlayBaseProps &
@@ -106,6 +111,7 @@ export const AnchoredOverlay: React.FC<React.PropsWithChildren<AnchoredOverlayPr
106111
align = 'start',
107112
alignmentOffset,
108113
anchorOffset,
114+
className,
109115
}) => {
110116
const anchorRef = useProvidedRefOrCreate(externalAnchorRef)
111117
const [overlayRef, updateOverlayRef] = useRenderForcingRef<HTMLDivElement>()
@@ -191,6 +197,7 @@ export const AnchoredOverlay: React.FC<React.PropsWithChildren<AnchoredOverlayPr
191197
top={position?.top || 0}
192198
left={position?.left || 0}
193199
anchorSide={position?.anchorSide}
200+
className={className}
194201
{...overlayProps}
195202
>
196203
{children}

0 commit comments

Comments
 (0)