Class IgcSliderComponent

A slider component used to select numeric value within a range.

igc-slider

igcInput - Emitted when a value is changed via thumb drag or keyboard interaction.

igcChange - Emitted when a value change is committed on a thumb drag end or keyboard interaction.

base - The base wrapper of the slider.

ticks - The ticks container.

tick-group - The tick group container.

tick - The tick element.

tick-label - The tick label element.

tick-label-inner - The inner element of the tick label.

thumbs - The thumbs container.

thumb - The thumb element.

thumb-label - The thumb tooltip label container.

thumb-label-inner - The thumb tooltip label inner element.

track - The track container.

steps - The track steps element.

inactive - The inactive element of the track.

fill - The filled part of the track.

Hierarchy

Hierarchy

  • FormAssociatedElementInterface<this> & EventEmitterInterface<IgcSliderEventMap, this> & IgcSliderBaseComponent<this>
    • IgcSliderComponent

Other

disabled: boolean

The disabled state of the component

[disabled=false]

discreteTrack: boolean = false

Marks the slider track as discrete so it displays the steps. If the step is 0, the slider will remain continuos even if discreteTrack is true.

discrete-track

hidePrimaryLabels: boolean = false

Hides the primary tick labels.

hide-primary-labels

hideSecondaryLabels: boolean = false

Hides the secondary tick labels.

hide-secondary-labels

hideTooltip: boolean = false

Hides the thumb tooltip.

hide-tooltip

invalid: boolean

Control the validity of the control.

locale: string = 'en'

The locale used to format the thumb and tick label values in the slider.

name: string

The name attribute of the control.

primaryTicks: number = 0

The number of primary ticks. It defaults to 0 which means no primary ticks are displayed.

primary-ticks

secondaryTicks: number = 0

The number of secondary ticks. It defaults to 0 which means no secondary ticks are displayed.

secondary-ticks

tickLabelRotation: -90 | 0 | 90 = 0

The degrees for the rotation of the tick labels. Defaults to 0.

tick-label-rotation

tickOrientation: "end" | "start" | "mirror" = 'end'

Changes the orientation of the ticks.

tick-orientation

valueFormat?: string

String format used for the thumb and tick label values in the slider.

value-format

valueFormatOptions?: NumberFormatOptions

Number format options used for the thumb and tick label values in the slider.

tagName: "igc-slider" = 'igc-slider'

Returns the HTML-uppercased qualified name.

MDN Reference

  • get form(): null | HTMLFormElement
  • Returns the HTMLFormElement associated with this element.

    Returns null | HTMLFormElement

  • set lowerBound(value): void
  • The lower bound of the slider value. If not set, the min value is applied.

    lower-bound

    Parameters

    • value: number

    Returns void

  • set max(value): void
  • The maximum value of the slider scale. Defaults to 100.

    If max is less than min the call is a no-op.

    If labels are provided (projected), then max is always set to the number of labels.

    If upperBound ends up being greater than than the current max value, it is automatically assigned the new max value.

    Parameters

    • value: number

    Returns void

  • set min(value): void
  • The minimum value of the slider scale. Defaults to 0.

    If min is greater than max the call is a no-op.

    If labels are provided (projected), then min is always set to 0.

    If lowerBound ends up being less than than the current min value, it is automatically assigned the new min value.

    Parameters

    • value: number

    Returns void

  • set step(value): void
  • Specifies the granularity that the value must adhere to.

    If set to 0 no stepping is implied and any value in the range is allowed. If labels are provided (projected) then the step is always assumed to be 1 since it is a discrete slider.

    Parameters

    • value: number

    Returns void

  • set upperBound(value): void
  • The upper bound of the slider value. If not set, the max value is applied.

    upper-bound

    Parameters

    • value: number

    Returns void

  • get validationMessage(): string
  • A string containing the validation message of this element.

    Returns string

  • 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

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

    Returns boolean

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

    Returns boolean

  • 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

  • Decrements the value of the slider by stepDecrement * step, where stepDecrement defaults to 1.

    Parameters

    • stepDecrement: number = 1

      Optional step decrement. If no parameter is passed, it defaults to 1.

    Returns void

  • Increments the value of the slider by stepIncrement * step, where stepIncrement defaults to 1.

    Parameters

    • stepIncrement: number = 1

      Optional step increment. If no parameter is passed, it defaults to 1.

    Returns void

lifecycle

  • Invoked when the component is added to the document's DOM.

    In connectedCallback() you should setup tasks that should only occur when the element is connected to the document. The most common of these is adding event listeners to nodes external to the element, like a keydown event handler added to the window.

    connectedCallback() {
    super.connectedCallback();
    addEventListener('keydown', this._handleKeydown);
    }

    Typically, anything done in connectedCallback() should be undone when the element is disconnected, in disconnectedCallback().

    Returns void