UNPKG

1.25 kBTypeScriptView Raw
1import * as React from 'react';
2import { FormGroupProps } from '../FormGroup';
3
4export interface RadioGroupProps extends Omit<FormGroupProps, 'onChange'> {
5 /**
6 * The default value. Use when the component is not controlled.
7 */
8 defaultValue?: any;
9 /**
10 * The name used to reference the value of the control.
11 * If you don't provide this prop, it falls back to a randomly generated name.
12 */
13 name?: string;
14 /**
15 * Callback fired when a radio button is selected.
16 *
17 * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
18 * @param {string} value The value of the selected radio button.
19 * You can pull out the new value by accessing `event.target.value` (string).
20 */
21 onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
22 /**
23 * Value of the selected radio button. The DOM API casts this to a string.
24 */
25 value?: any;
26}
27
28/**
29 *
30 * Demos:
31 *
32 * - [Radio Group](https://mui.com/material-ui/react-radio-button/)
33 *
34 * API:
35 *
36 * - [RadioGroup API](https://mui.com/material-ui/api/radio-group/)
37 * - inherits [FormGroup API](https://mui.com/material-ui/api/form-group/)
38 */
39export default function RadioGroup(props: RadioGroupProps): React.JSX.Element;