Skip to main content

Interface: NumberInput

Defined in: block-kit/block-elements.ts:486

Description

Allows user to enter a number into a single-line field. The number input element accepts both whole and decimal numbers. For example, 0.25, 5.5, and -10 are all valid input values. Decimal numbers are only allowed when is_decimal_allowed is equal to true.

See

Extends

Properties

action_id?

optional action_id: string;

Defined in: block-kit/extensions.ts:15

@description: An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_ids in the containing block. Maximum length for this field is 255 characters.

Inherited from

Actionable.action_id


dispatch_action_config?

optional dispatch_action_config: DispatchActionConfig;

Defined in: block-kit/extensions.ts:33

Description

A DispatchActionConfig object that determines when during text input the element returns a `block_actions` payload.

Inherited from

Dispatchable.dispatch_action_config


focus_on_load?

optional focus_on_load: boolean;

Defined in: block-kit/extensions.ts:42

Description

Indicates whether the element will be set to auto focus within the `view` object. Only one element can be set to true. Defaults to false.

Inherited from

Focusable.focus_on_load


initial_value?

optional initial_value: string;

Defined in: block-kit/block-elements.ts:498

Description

The initial value in the input when it is loaded.


is_decimal_allowed

is_decimal_allowed: boolean;

Defined in: block-kit/block-elements.ts:494

Description

Decimal numbers are allowed if this property is true, set the value to false otherwise.


max_value?

optional max_value: string;

Defined in: block-kit/block-elements.ts:506

Description

The maximum value, cannot be less than min_value.


min_value?

optional min_value: string;

Defined in: block-kit/block-elements.ts:502

Description

The minimum value, cannot be greater than max_value.


placeholder?

optional placeholder: PlainTextElement;

Defined in: block-kit/extensions.ts:57

Description

A PlainTextElement object that defines the placeholder text shown on the element. Maximum length for the text field in this object is 150 characters.

Inherited from

Placeholdable.placeholder


type

type: "number_input";

Defined in: block-kit/block-elements.ts:490

Description

The type of element. In this case type is always number_input.

Overrides

Actionable.type