@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
83 lines (82 loc) • 2.55 kB
TypeScript
/**
* MSKCC DSM 2021, 2023
*/
import { ReactNodeLike } from 'prop-types';
import React from 'react';
export declare const RadioButtonGroupContext: React.Context<null>;
type ExcludedAttributes = 'onChange';
type sizes = 'sm' | 'md' | 'lg';
export interface RadioButtonGroupProps extends Omit<React.InputHTMLAttributes<HTMLFieldSetElement>, ExcludedAttributes> {
/**
* Provide a collection of `<RadioButton>` components to render in the group
*/
children?: ReactNodeLike;
/**
* Provide an optional className to be applied to the container node
*/
className?: string;
/**
* Specify the `<RadioButton>` to be selected by default
*/
defaultSelected?: string | number;
/**
* Specify whether the group is disabled
*/
disabled?: boolean;
/**
* Provide text that is used alongside the control label for additional help
*/
helperText?: ReactNodeLike;
/**
* Specify whether the control is currently invalid
*/
invalid?: boolean;
/**
* Provide the text that is displayed when the control is in an invalid state
*/
invalidText?: ReactNodeLike;
/**
* Provide where label text should be placed
*/
labelPosition?: 'left' | 'right';
/**
* Provide a legend to the RadioButtonGroup input that you are
* exposing to the user
*/
legendText?: ReactNodeLike;
/**
* Specify the name of the underlying `<input>` nodes
*/
name: string;
/**
* Provide an optional `onChange` hook that is called whenever the value of
* the group changes
*/
onChange?: (selection: unknown, name: string, evt: unknown) => void;
/**
* Provide where radio buttons should be placed
*/
orientation?: 'horizontal' | 'vertical';
/**
* Whether the RadioButtonGroup should be read-only
*/
readOnly?: boolean;
/**
* Specify the size of the RadioButtonGroup. Currently supports either `default`, `md` or `lg` as an option.
*/
radioSize?: sizes;
/**
* Specify whether the control is currently in warning state
*/
warn?: boolean;
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText?: ReactNodeLike;
/**
* Specify the value that is currently selected in the group
*/
valueSelected?: string | number;
}
declare const RadioButtonGroup: React.ForwardRefExoticComponent<RadioButtonGroupProps & React.RefAttributes<unknown>>;
export default RadioButtonGroup;