UNPKG

@mui/material

Version:

Quickly build beautiful React apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

42 lines (38 loc) 1.29 kB
import * as React from 'react'; import { FormGroupProps } from '../FormGroup'; export interface RadioGroupProps extends Omit<FormGroupProps, 'onChange'> { /** * The default value. Use when the component is not controlled. */ defaultValue?: any; /** * The name used to reference the value of the control. * If you don't provide this prop, it falls back to a randomly generated name. */ name?: string; /** * Callback fired when a radio button is selected. * * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback. * @param {string} value The value of the selected radio button. * You can pull out the new value by accessing `event.target.value` (string). */ onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void; /** * Value of the selected radio button. The DOM API casts this to a string. */ value?: any; } export type RadioGroupClassKey = keyof NonNullable<RadioGroupProps['classes']>; /** * * Demos: * * - [Radio Buttons](https://mui.com/components/radio-buttons/) * * API: * * - [RadioGroup API](https://mui.com/api/radio-group/) * - inherits [FormGroup API](https://mui.com/api/form-group/) */ export default function RadioGroup(props: RadioGroupProps): JSX.Element;