Skip to content

Commit 27803f9

Browse files
committed
feat: allow radio label as react node
affects: @medly-components/core
1 parent a001f6d commit 27803f9

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/core/src/components/Radio/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { LabelPositions } from '../Label/types';
44

55
type InputProps = Omit<HTMLProps<HTMLInputElement>, 'size' | 'type' | 'sizes'>;
66

7-
export interface RadioProps extends InputProps {
7+
export interface RadioProps extends Omit<InputProps, 'label'> {
88
/** Value of the radio group */
99
value: any;
1010
/** Radio size */
@@ -14,7 +14,7 @@ export interface RadioProps extends InputProps {
1414
/** Error state for checkbox */
1515
hasError?: boolean;
1616
/** Radio label */
17-
label?: string;
17+
label?: string | React.ReactNode;
1818
/** Label position */
1919
labelPosition?: LabelPositions;
2020
/** Label variant */

packages/core/src/components/RadioGroup/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface RadioGroupProps extends Omit<HTMLProps<HTMLDivElement>, 'size'
99
/** Function to be called on selecting any radio */
1010
onChange?: (value: any) => void;
1111
/** Options */
12-
options: { value: any; label: string; disabled?: boolean }[];
12+
options: { value: any; label: string | React.ReactNode; disabled?: boolean }[];
1313
/** Function will be called with the input value on Blur event */
1414
validator?: (val: any) => string;
1515
/** Takes full width of the parent component */

0 commit comments

Comments
 (0)