UNPKG

@cimpress/react-components

Version:
25 lines 1.24 kB
import React, { ChangeEvent, ReactNode } from 'react'; import { PublicComponentProps } from '../types'; export interface RadioGroupProps extends PublicComponentProps { /** Pass <Radio /> elements as children to the RadioGroup */ children?: ReactNode; /** The default radio group selection. If no default is defined, no radio button will be initially selected. */ defaultSelected?: any; /** If true, radio options will display in a row instead of stacked. If there is not enough width for all options, radios will wrap. */ inline?: boolean; /** Name to apply to the child radio buttons. */ name: string; /** Callback function that is fired when the selected radio button changes. */ onChange?: (e: ChangeEvent<HTMLInputElement>, value: any) => void; /** The current selected value of the radio group. */ valueSelected?: any; } interface RadioGroupContextProps { name: string; selected: any; onChange: (event: ChangeEvent<HTMLInputElement>, value: any) => void; } export declare const RadioGroup: (props: RadioGroupProps) => React.JSX.Element; export declare const useRadioGroupContext: () => RadioGroupContextProps | undefined; export {}; //# sourceMappingURL=RadioGroup.d.ts.map