UNPKG

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