Skip to content

Commit 4314d62

Browse files
gabrieljablonskiGabriel Jablonski
authored andcommitted
feat: tooltip wrapper custom classname
1 parent ca4d959 commit 4314d62

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/components/TooltipProvider/TooltipProviderTypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type TooltipContextDataWrapper = TooltipContextData & {
1919
export interface ITooltipWrapper {
2020
tooltipId?: string
2121
children: ReactNode
22+
className?: string
2223

2324
place?: ITooltipController['place']
2425
content?: ITooltipController['content']

src/components/TooltipProvider/TooltipWrapper.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { useEffect, useRef } from 'react'
2+
import classNames from 'classnames'
23
import { useTooltip } from './TooltipProvider'
34
import type { ITooltipWrapper } from './TooltipProviderTypes'
45

56
const TooltipWrapper = ({
67
tooltipId,
78
children,
9+
className,
810
place,
911
content,
1012
html,
@@ -29,6 +31,7 @@ const TooltipWrapper = ({
2931
return (
3032
<span
3133
ref={anchorRef}
34+
className={classNames('react-tooltip-wrapper', className)}
3235
data-tooltip-place={place}
3336
data-tooltip-content={content}
3437
data-tooltip-html={html}

0 commit comments

Comments
 (0)