@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
100 lines (99 loc) • 2.92 kB
TypeScript
/**
* MSKCC DSM 2021, 2024
*/
import { ReactNodeLike } from 'prop-types';
import React from 'react';
export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaElement> {
/**
* Provide a custom className that is applied directly to the underlying
* `<textarea>` node
*/
className?: string;
/**
* Specify the `cols` attribute for the underlying `<textarea>` node
*/
cols?: number;
/**
* Optionally provide the default value of the `<textarea>`
*/
defaultValue?: string | number;
/**
* Specify whether the control is disabled
*/
disabled?: boolean;
/**
* Specify whether to display the character counter
*/
enableCounter?: boolean;
/**
* Provide text that is used alongside the control label for additional help
*/
helperText?: ReactNodeLike;
/**
* Specify whether you want the underlying label to be visually hidden
*/
hideLabel?: boolean;
/**
* Provide a unique identifier for the control
*/
id?: string;
/**
* 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 the text that will be read by a screen reader when visiting this
* control
*/
labelText: ReactNodeLike;
/**
* @deprecated
* `true` to use the light version. For use on $ui-01 backgrounds only.
* Don't use this to make tile background color same as container background color.
*/
light?: boolean;
/**
* Max character count allowed for the textarea. This is needed in order for enableCounter to display
*/
maxCount?: number;
/**
* Optionally provide an `onChange` handler that is called whenever `<textarea>`
* is updated
*/
onChange?: (evt: React.ChangeEvent<HTMLTextAreaElement>) => void;
/**
* Optionally provide an `onClick` handler that is called whenever the
* `<textarea>` is clicked
*/
onClick?: (evt: React.MouseEvent<HTMLTextAreaElement>) => void;
/**
* Specify the placeholder attribute for the `<textarea>`
*/
placeholder?: string;
/**
* Whether the textarea should be read-only
*/
readOnly?: boolean;
/**
* Specify the rows attribute for the `<textarea>`
*/
rows?: number;
/**
* Provide the current value of the `<textarea>`
*/
value?: string | number;
/**
* 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;
}
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<unknown>>;
export default TextArea;