1 | import * as React from 'react';
|
2 | import { StandardProps } from '..';
|
3 |
|
4 | export interface FormControlLabelProps
|
5 | extends StandardProps<
|
6 | React.LabelHTMLAttributes<HTMLLabelElement>,
|
7 | FormControlLabelClassKey,
|
8 | 'children' | 'onChange'
|
9 | > {
|
10 | /**
|
11 | * If `true`, the component appears selected.
|
12 | */
|
13 | checked?: boolean;
|
14 | /**
|
15 | * A control element. For instance, it can be be a `Radio`, a `Switch` or a `Checkbox`.
|
16 | */
|
17 | control: React.ReactElement<any, any>;
|
18 | /**
|
19 | * If `true`, the control will be disabled.
|
20 | */
|
21 | disabled?: boolean;
|
22 | /**
|
23 | * Pass a ref to the `input` element.
|
24 | */
|
25 | inputRef?: React.Ref<any>;
|
26 | /**
|
27 | * The text to be used in an enclosing label element.
|
28 | */
|
29 | label: React.ReactNode;
|
30 | /**
|
31 | * The position of the label.
|
32 | */
|
33 | labelPlacement?: 'end' | 'start' | 'top' | 'bottom';
|
34 | name?: string;
|
35 | /**
|
36 | * Callback fired when the state is changed.
|
37 | *
|
38 | * @param {object} event The event source of the callback.
|
39 | * You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
40 | */
|
41 | onChange?: (event: React.ChangeEvent<{}>, checked: boolean) => void;
|
42 | /**
|
43 | * The value of the component.
|
44 | */
|
45 | value?: unknown;
|
46 | }
|
47 |
|
48 | export type FormControlLabelClassKey =
|
49 | | 'root'
|
50 | | 'labelPlacementStart'
|
51 | | 'labelPlacementTop'
|
52 | | 'labelPlacementBottom'
|
53 | | 'disabled'
|
54 | | 'label';
|
55 |
|
56 | /**
|
57 | * Drop in replacement of the `Radio`, `Switch` and `Checkbox` component.
|
58 | * Use this component if you want to display an extra label.
|
59 | * Demos:
|
60 | *
|
61 | * - [Checkboxes](https://mui.com/components/checkboxes/)
|
62 | * - [Radio Buttons](https://mui.com/components/radio-buttons/)
|
63 | * - [Switches](https://mui.com/components/switches/)
|
64 | *
|
65 | * API:
|
66 | *
|
67 | * - [FormControlLabel API](https://mui.com/api/form-control-label/)
|
68 | */
|
69 | export default function FormControlLabel(props: FormControlLabelProps): JSX.Element;
|