UNPKG

2.23 kBTypeScriptView Raw
1import * as React from "react";
2import { AbstractPureComponent } from "../../common";
3import { type IntentProps, type Props } from "../../common/props";
4export interface TextAreaProps extends IntentProps, Props, React.TextareaHTMLAttributes<HTMLTextAreaElement> {
5 /**
6 * Set this to `true` if you will be controlling the `value` of this input with asynchronous updates.
7 * These may occur if you do not immediately call setState in a parent component with the value from
8 * the `onChange` handler, or if working with certain libraries like __redux-form__.
9 *
10 * @default false
11 */
12 asyncControl?: boolean;
13 /**
14 * Whether the component should automatically resize vertically as a user types in the text input.
15 * This will disable manual resizing in the vertical dimension.
16 *
17 * @default false
18 */
19 autoResize?: boolean;
20 /**
21 * Whether the text area should take up the full width of its container.
22 *
23 * @default false
24 */
25 fill?: boolean;
26 /**
27 * Whether the text area should automatically grow vertically to accomodate content.
28 *
29 * @deprecated use the `autoResize` prop instead.
30 */
31 growVertically?: boolean;
32 /**
33 * Ref handler that receives HTML `<textarea>` element backing this component.
34 */
35 inputRef?: React.Ref<HTMLTextAreaElement>;
36 /**
37 * Whether the text area should appear with large styling.
38 *
39 * @default false
40 */
41 large?: boolean;
42 /**
43 * Whether the text area should appear with small styling.
44 *
45 * @default false
46 */
47 small?: boolean;
48}
49export interface TextAreaState {
50 height?: number;
51}
52/**
53 * Text area component.
54 *
55 * @see https://blueprintjs.com/docs/#core/components/text-area
56 */
57export declare class TextArea extends AbstractPureComponent<TextAreaProps, TextAreaState> {
58 static defaultProps: TextAreaProps;
59 static displayName: string;
60 state: TextAreaState;
61 textareaElement: HTMLTextAreaElement | null;
62 private handleRef;
63 private maybeSyncHeightToScrollHeight;
64 componentDidMount(): void;
65 componentDidUpdate(prevProps: TextAreaProps): void;
66 render(): React.JSX.Element;
67 private handleChange;
68}