Skip to content

Commit 34108bb

Browse files
authored
feat(RadioButton): add ariaLabel & ariaDescribedBy (#3112)
1 parent 666bc76 commit 34108bb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/core/src/components/RadioButton/RadioButton.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ export interface RadioButtonProps extends VibeComponentProps {
7070
* If true, disables the label animation.
7171
*/
7272
noLabelAnimation?: boolean;
73+
/**
74+
* ARIA label for accessibility when no text is provided.
75+
*/
76+
ariaLabel?: string;
77+
/**
78+
* ID of element that describe this radio button.
79+
*/
80+
ariaDescribedby?: string;
7381
}
7482

7583
const RadioButton = forwardRef(
@@ -97,6 +105,8 @@ const RadioButton = forwardRef(
97105
retainChildClick = true,
98106
childrenTabIndex = "0",
99107
noLabelAnimation = false,
108+
ariaLabel,
109+
ariaDescribedby,
100110
id,
101111
"data-testid": dataTestId
102112
}: RadioButtonProps,
@@ -143,6 +153,8 @@ const RadioButton = forwardRef(
143153
autoFocus={autoFocus}
144154
disabled={disabled}
145155
{...checkedProps}
156+
aria-label={ariaLabel}
157+
aria-describedby={ariaDescribedby}
146158
onChange={onSelect}
147159
ref={mergedRef}
148160
/>

0 commit comments

Comments
 (0)