UNPKG

2.04 kBTypeScriptView Raw
1import * as React from "react";
2import { AbstractPureComponent2 } from "../../common";
3import { OptionProps, Props } from "../../common/props";
4export declare type RadioGroupProps = IRadioGroupProps;
5/** @deprecated use RadioGroupProps */
6export interface IRadioGroupProps extends Props {
7 /**
8 * Radio elements. This prop is mutually exclusive with `options`.
9 */
10 children?: React.ReactNode;
11 /**
12 * Whether the group and _all_ its radios are disabled.
13 * Individual radios can be disabled using their `disabled` prop.
14 */
15 disabled?: boolean;
16 /**
17 * Whether the radio buttons are to be displayed inline horizontally.
18 */
19 inline?: boolean;
20 /** Optional label text to display above the radio buttons. */
21 label?: React.ReactNode;
22 /**
23 * Name of the group, used to link radio buttons together in HTML.
24 * If omitted, a unique name will be generated internally.
25 */
26 name?: string;
27 /**
28 * Callback invoked when the currently selected radio changes.
29 * Use `event.currentTarget.value` to read the currently selected value.
30 * This prop is required because this component only supports controlled usage.
31 */
32 onChange: (event: React.FormEvent<HTMLInputElement>) => void;
33 /**
34 * Array of options to render in the group. This prop is mutually exclusive
35 * with `children`: either provide an array of `OptionProps` objects or
36 * provide `<Radio>` children elements.
37 */
38 options?: readonly OptionProps[];
39 /** Value of the selected radio. The child with this value will be `:checked`. */
40 selectedValue?: string | number;
41}
42/**
43 * Radio group component.
44 *
45 * @see https://blueprintjs.com/docs/#core/components/radio.radiogroup
46 */
47export declare class RadioGroup extends AbstractPureComponent2<RadioGroupProps> {
48 static displayName: string;
49 private autoGroupName;
50 render(): JSX.Element;
51 protected validateProps(): void;
52 private renderChildren;
53 private renderOptions;
54 private getRadioProps;
55}