UNPKG

2.01 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { OverridableStringUnion } from '@mui/types';
4import { InternalStandardProps as StandardProps, Theme } from '..';
5import { SwitchBaseProps } from '../internal/SwitchBase';
6import { RadioClasses } from './radioClasses';
7
8export interface RadioPropsSizeOverrides {}
9
10export interface RadioPropsColorOverrides {}
11
12export interface RadioProps
13 extends StandardProps<SwitchBaseProps, 'checkedIcon' | 'color' | 'icon' | 'type'> {
14 /**
15 * The icon to display when the component is checked.
16 * @default <RadioButtonIcon checked />
17 */
18 checkedIcon?: React.ReactNode;
19 /**
20 * Override or extend the styles applied to the component.
21 */
22 classes?: Partial<RadioClasses>;
23 /**
24 * The color of the component.
25 * It supports both default and custom theme colors, which can be added as shown in the
26 * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
27 * @default 'primary'
28 */
29 color?: OverridableStringUnion<
30 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default',
31 RadioPropsColorOverrides
32 >;
33 /**
34 * If `true`, the component is disabled.
35 */
36 disabled?: boolean;
37 /**
38 * The icon to display when the component is unchecked.
39 * @default <RadioButtonIcon />
40 */
41 icon?: React.ReactNode;
42 /**
43 * The size of the component.
44 * `small` is equivalent to the dense radio styling.
45 * @default 'medium'
46 */
47 size?: OverridableStringUnion<'small' | 'medium', RadioPropsSizeOverrides>;
48 /**
49 * The system prop that allows defining system overrides as well as additional CSS styles.
50 */
51 sx?: SxProps<Theme>;
52}
53
54/**
55 *
56 * Demos:
57 *
58 * - [Radio Group](https://mui.com/material-ui/react-radio-button/)
59 *
60 * API:
61 *
62 * - [Radio API](https://mui.com/material-ui/api/radio/)
63 * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
64 */
65export default function Radio(props: RadioProps): React.JSX.Element;