Class IgcInputComponent

Element

igc-input

Slot

prefix - Renders content before the input.

Slot

suffix - Renders content after input.

Slot

helper-text - Renders content below the input.

Fires

igcInput - Emitted when the control input receives user input.

Fires

igcChange - Emitted when the control's checked state changes.

Fires

igcFocus - Emitted when the control gains focus.

Fires

igcBlur - Emitted when the control loses focus.

Csspart

container - The main wrapper that holds all main input elements.

Csspart

input - The native input element.

Csspart

label - The native label element.

Csspart

prefix - The prefix wrapper.

Csspart

suffix - The suffix wrapper.

Csspart

helper-text - The helper text wrapper.

Hierarchy

Hierarchy

  • IgcInputBaseComponent
    • IgcInputComponent

Constructors

Properties

autocomplete: string

The autocomplete attribute of the control.

Attr

autofocus: boolean

The autofocus attribute of the control.

Attr

disabled: boolean

The disabled state of the component

Attr

[disabled=false]

inputmode: "search" | "numeric" | "none" | "url" | "email" | "tel" | "decimal" | "txt"

The input mode attribute of the control.

Attr

invalid: boolean

Control the validity of the control.

Attr

label: string

The label for the control.

Attr

max: string | number

The max attribute of the control.

Attr

maxLength: number

The maximum string length of the control.

Attr

maxlength

min: string | number

The min attribute of the control.

Attr

minLength: number

The minimum string length required by the control.

Attr

minlength

name: string

The name attribute of the control.

Attr

outlined: boolean = false

Whether the control will have outlined appearance.

Attr

pattern: string

The pattern attribute of the control.

Attr

placeholder: string

The placeholder attribute of the control.

Attr

readOnly: boolean = false

Makes the control a readonly field.

Attr

readonly

required: boolean

Makes the control a required field in a form context.

Attr

size: "small" | "medium" | "large"

Determines the size of the component.

Attr

Deprecated

  • since v4.5.0. Use the --ig-size CSS custom property instead.
step: number

The step attribute of the control.

Attr

tabIndex: number = 0
type: "number" | "search" | "url" | "text" | "email" | "tel" | "password" = 'text'

The type attribute of the control.

Attr

value: string = ''

The value of the control.

Attr

styles: CSSResult = styles
tagName: "igc-input" = 'igc-input'

Accessors

  • get readonly(): boolean
  • Makes the control a readonly field.

    Deprecated

    • since v4.4.0 Use the readOnly property instead.

    Returns boolean

  • set readonly(value): void
  • Parameters

    • value: boolean

    Returns void

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

    Returns ValidityState

  • get willValidate(): boolean
  • A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

    Returns boolean

Methods

  • Type parameters

    Type Parameters

    • K extends keyof IgcInputEventMap

    • D extends string | void

    Parameters

    • type: K
    • Optional eventInitDict: CustomEventInit<D>

    Returns boolean

  • Sets focus on the control.

    Parameters

    • Optional options: FocusOptions

    Returns void

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

    Parameters

    • message: string

    Returns void

  • Replaces the selected text in the input.

    Parameters

    • replacement: string
    • start: number
    • end: number
    • selectMode: "end" | "start" | "select" | "preserve" = 'preserve'

    Returns void

  • Sets the text selection range of the control

    Parameters

    • start: number
    • end: number
    • direction: "none" | "forward" | "backward" = 'none'

    Returns void

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

    Parameters

    • Optional n: number

    Returns void