Element
igc-input
Slots
prefix — Renders content before the input.
suffix — Renders content after input.
helper-text — Renders content below the input.
value-missing — Renders content when the required validation fails.
type-mismatch — Renders content when the a type url/email input pattern validation fails.
pattern-mismatch — Renders content when the pattern validation fails.
too-long — Renders content when the maxlength validation fails.
too-short — Renders content when the minlength validation fails.
range-overflow — Renders content when the max validation fails.
range-underflow — Renders content when the min validation fails.
step-mismatch — Renders content when the step validation fails.
custom-error — Renders content when setCustomValidity(message) is set.
invalid — Renders content when the component is in invalid state (validity.valid = false).
CSS Parts
container — The main wrapper that holds all main input elements.
input — The native input element.
label — The native label element.
prefix — The prefix wrapper.
suffix — The suffix wrapper.
helper-text — The helper text wrapper.

The autocomplete attribute of the control.

autocomplete: string

Defined in src/components/input/input.ts:231

The autofocus attribute of the control.

autofocus: boolean

Defined in src/components/input/input.ts:224

Inherited from: IgcInputBaseComponent

The disabled state of the component.

disabled: boolean

Defined in src/components/common/mixins/forms/types.ts:29

The input mode attribute of the control. See relevant MDN article

inputMode: string

Defined in src/components/input/input.ts:133

Inherited from: IgcInputBaseComponent

Sets the control into invalid state (visual state only).

invalid: boolean

Defined in src/components/common/mixins/forms/types.ts:36

Inherited from: IgcInputBaseComponent

The label for the control.

label: string

Defined in src/components/input/input-base.ts:70

Inherited from: IgcInputBaseComponent

The name attribute of the control.

name: string

Defined in src/components/common/mixins/forms/types.ts:42

Inherited from: IgcInputBaseComponent

Whether the control will have outlined appearance.

outlined: boolean = false

Defined in src/components/input/input-base.ts:56

Inherited from: IgcInputBaseComponent

The placeholder attribute of the control.

placeholder: string

Defined in src/components/input/input-base.ts:63

Makes the control a readonly field.

readOnly: boolean = false

Defined in src/components/input/input.ts:125

The type attribute of the control.

type: InputType = 'text'

Defined in src/components/input/input.ts:116

Enables validation rules to be evaluated without restricting user input. This applies to the maxLength property for string-type inputs or allows spin buttons to exceed the predefined min/max limits for number-type inputs.

validateOnly: boolean = false

Defined in src/components/input/input.ts:241

value: string

Defined in src/components/input/input.ts:102, src/components/input/input.ts:106

Inherited from: IgcInputBaseComponent

Returns the HTMLFormElement associated with this element.

get form(): HTMLFormElement | null

Defined in src/components/common/mixins/forms/types.ts:45

Returns HTMLFormElement | null

Inherited from: IgcInputBaseComponent

A string containing the validation message of this element.

get validationMessage(): string

Defined in src/components/common/mixins/forms/types.ts:54

Returns string

Inherited from: IgcInputBaseComponent

Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.

get validity(): ValidityState

Defined in src/components/common/mixins/forms/types.ts:51

Returns ValidityState

Inherited from: IgcInputBaseComponent

A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

get willValidate(): boolean

Defined in src/components/common/mixins/forms/types.ts:60

Returns boolean

Inherited from: IgcInputBaseComponent

Removes focus from the control.

blur(): void

Defined in src/components/input/input-base.ts:102

Returns void

Inherited from: IgcInputBaseComponent

Checks for validity of the control and emits the invalid event if it invalid.

checkValidity(): boolean

Defined in src/components/common/mixins/forms/types.ts:140

Returns boolean

Inherited from: IgcInputBaseComponent

Sets focus on the control.

focus(options: FocusOptions): void

Defined in src/components/input/input-base.ts:96

Parameters

  • options: FocusOptions

Returns void

Inherited from: IgcInputBaseComponent

Checks for validity of the control and shows the browser message if it invalid.

reportValidity(): boolean

Defined in src/components/common/mixins/forms/types.ts:143

Returns boolean

Inherited from: IgcInputBaseComponent

Selects all the text inside the input.

select(): void

Defined in src/components/input/input-base.ts:90

Returns void

Inherited from: IgcInputBaseComponent

Sets a custom validation message for the control. As long as message is not empty, the control is considered invalid.

setCustomValidity(message: string): void

Defined in src/components/common/mixins/forms/types.ts:149

Parameters

  • message: string

Returns void

Replaces the selected text in the input.

setRangeText(replacement: string, start: number, end: number, selectMode: RangeTextSelectMode): void

Defined in src/components/input/input.ts:245

Parameters

  • replacement: string
  • start: number
  • end: number
  • selectMode: RangeTextSelectMode

Returns void

Sets the text selection range of the control

setSelectionRange(start: number, end: number, direction: SelectionRangeDirection): void

Defined in src/components/input/input.ts:257

Parameters

  • start: number
  • end: number
  • direction: SelectionRangeDirection

Returns void

Decrements the numeric value of the input by one or more steps.

stepDown(n: number): void

Defined in src/components/input/input.ts:272

Parameters

  • n: number

Returns void

Increments the numeric value of the input by one or more steps.

stepUp(n: number): void

Defined in src/components/input/input.ts:266

Parameters

  • n: number

Returns void