Skip to content

Commit c8f44f2

Browse files
authored
feat: add tooltip support to radio group (#1378)
1 parent 361b662 commit c8f44f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/fields/RadioGroup.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import type { ChangeEvent, FC, ReactNode } from 'react';
22
import type { RadioGroupItem } from '../../types';
33
import { cn } from '../../utils/cn';
4+
import { Tooltip } from './Tooltip';
45

56
export interface IRadioGroup {
67
name: string;
78
label: string;
89
helpText?: ReactNode | string;
10+
tooltip?: ReactNode | string;
911
options: RadioGroupItem[];
1012
value: string;
1113
disabled?: boolean;
@@ -26,6 +28,9 @@ export const RadioGroup: FC<IRadioGroup> = (props: IRadioGroup) => {
2628
}
2729
>
2830
{props.label}
31+
{props.tooltip && (
32+
<Tooltip name={`tooltip-${props.name}`} tooltip={props.tooltip} />
33+
)}
2934
</label>
3035
</div>
3136

0 commit comments

Comments
 (0)