@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
42 lines (41 loc) • 1.54 kB
TypeScript
import { KendoComponent } from '../_types/component';
export declare const RADIOBUTTON_CLASSNAME = "k-radio";
declare const states: ("required" | "focus" | "invalid" | "disabled" | "checked" | "valid" | "hover")[];
declare const options: {
size: ("small" | "medium" | "large" | undefined)[];
};
export type RadioButtonProps = RadioButtonOptions & {
id?: string;
};
export type RadioButtonState = {
[K in (typeof states)[number]]?: boolean;
};
export type RadioButtonOptions = {
size?: (typeof options.size)[number] | null;
};
/**
* RadioButton component - native radio input element.
*
* @accessibility
* - Uses native `<input type="radio">` (role="radio" is implicit)
* - Must have accessible name via `<label>`, `aria-label`, or `aria-labelledby`
* - Native `checked` property handles checked state
* - Uses native `disabled` attribute for disabled state
* - Use `aria-invalid="true"` when validation fails
* - Use `aria-describedby` to link to hint or error messages
*
* @example
* ```tsx
* // With label element
* <RadioButton id="option1" name="options" />
* <label htmlFor="option1">Option 1</label>
*
* // With aria-label
* <RadioButton name="options" aria-label="Select option" />
* ```
*
* @wcag 4.1.2 Name, Role, Value - radio must have accessible name
* @wcag 1.3.1 Info and Relationships - label must be programmatically associated
*/
export declare const RadioButton: KendoComponent<RadioButtonProps & RadioButtonState & React.HTMLAttributes<HTMLInputElement>>;
export default RadioButton;