UNPKG

1.52 kBTypeScriptView Raw
1/// <reference types="react" />
2import type { IntentProps, MaybeElement, Props } from "../../common/props";
3import type { IconName } from "../icon/icon";
4/**
5 * Shared props interface for text & numeric inputs.
6 */
7export interface InputSharedProps extends IntentProps, Props {
8 /**
9 * Whether the input is non-interactive.
10 *
11 * Note that the content in `rightElement` must be disabled separately if defined;
12 * this prop will not affect it.
13 *
14 * @default false
15 */
16 disabled?: boolean;
17 /**
18 * Whether the component should take up the full width of its container.
19 */
20 fill?: boolean;
21 /**
22 * Ref attached to the HTML `<input>` element backing this component.
23 */
24 inputRef?: React.Ref<HTMLInputElement>;
25 /**
26 * Element to render on the left side of input.
27 * This prop is mutually exclusive with `leftIcon`.
28 */
29 leftElement?: JSX.Element;
30 /**
31 * Name of a Blueprint UI icon to render on the left side of the input group,
32 * before the user's cursor.
33 *
34 * This prop is mutually exclusive with `leftElement`.
35 *
36 * Note: setting a JSX.Element here is deprecated; use the `leftElement` prop instead.
37 */
38 leftIcon?: IconName | MaybeElement;
39 /**
40 * Placeholder text in the absence of any value.
41 */
42 placeholder?: string;
43 /**
44 * Element to render on right side of input.
45 * For best results, use a minimal button, tag, or small spinner.
46 */
47 rightElement?: JSX.Element;
48}