@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
62 lines (61 loc) • 1.86 kB
TypeScript
/**
* MSKCC DSM 2021, 2023
*/
import { ReactNodeLike } from 'prop-types';
import React from 'react';
type ExcludedAttributes = 'onChange';
export interface RadioButtonProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
/**
* Specify whether the `<RadioButton>` is currently checked
*/
checked?: boolean;
/**
* Provide an optional className to be applied to the containing node
*/
className?: string;
/**
* Specify whether the `<RadioButton>` should be checked by default
*/
defaultChecked?: boolean;
/**
* Specify whether the control is disabled
*/
disabled?: boolean;
/**
* Specify whether the label should be hidden, or not
*/
hideLabel?: boolean;
/**
* Provide a unique id for the underlying `<input>` node
*/
id?: string;
/**
* Provide where label text should be placed
* NOTE: `top`/`bottom` are deprecated
*/
labelPosition?: 'left' | 'right';
/**
* Provide label text to be read by screen readers when interacting with the
* control
*/
labelText: ReactNodeLike;
/**
* Provide a name for the underlying `<input>` node
*/
name?: string;
/**
* Provide an optional `onChange` hook that is called each time the value of
* the underlying `<input>` changes
*/
onChange?: (value: string | number, name: string | undefined, event: any) => void;
/**
* Provide a handler that is invoked when a user clicks on the control
*/
onClick?: (evt: React.MouseEvent<HTMLInputElement>) => void;
/**
* Specify the value of the `<RadioButton>`
*/
value?: string | number;
}
declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<unknown>>;
export default RadioButton;