@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
33 lines • 1.49 kB
TypeScript
import * as React from 'react';
import { RadioProps } from './Radio';
import { ErrorType, GrowthBehavior, Themeable } from '@workday/canvas-kit-react/common';
export interface RadioGroupProps extends Themeable, GrowthBehavior {
/**
* The Radio button children of the RadioGroup (must be at least two).
*/
children: React.ReactElement<RadioProps>[];
/**
* The selected value of the RadioGroup. If a string is provided, the Radio button with the corresponding value will be selected. If a number is provided, the Radio button with the corresponding index will be selected.
* @default 0
*/
value?: string | number;
/**
* The common `name` passed to all Radio button children of the RadioGroup. This enables you to avoid specifying the `name` for each child.
*/
name?: string;
/**
* The type of error associated with the RadioGroup (if applicable).
*/
error?: ErrorType;
/**
* The function called when the RadioGroup state changes. The value passed to the callback function will be the value of the selected Radio button if it has one; otherwise, the index of the selected Radio button will be passed in.
*/
onChange?: (value: string | number) => void;
}
export declare class RadioGroup extends React.Component<RadioGroupProps> {
static ErrorType: typeof ErrorType;
render(): React.ReactNode;
private renderChild;
private onRadioChange;
}
//# sourceMappingURL=RadioGroup.d.ts.map