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

Hierarchy

Hierarchy

Constructors

Properties

context: any

If using the new style context, re-declare this in your class to be the React.ContextType of your static contextType. Should be used with type annotation or static contextType.

static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
props: Readonly<IIgrSliderProps> & Readonly<{
    children?: ReactNode;
}>
refs: {
    [key: string]: ReactInstance;
}

Type declaration

  • [key: string]: ReactInstance
state: Readonly<{}>
contextType?: Context<any>

If set, this.context will be set at runtime to the current value of the given Context.

Usage:

type MyContext = number
const Ctx = React.createContext<MyContext>(0)

class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}

Accessors

  • get change(): ((s, e) => void)
  • Emitted when a value change is committed on a thumb drag end or keyboard interaction.

    Returns ((s, e) => void)

      • (s, e): void
      • Emitted when a value change is committed on a thumb drag end or keyboard interaction.

        Parameters

        Returns void

  • set change(ev): void
  • Parameters

    Returns void

  • get disabled(): boolean
  • Disables the UI interactions of the slider.

    Returns boolean

  • set disabled(v): void
  • Parameters

    • v: boolean

    Returns void

  • get discreteTrack(): boolean
  • 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.

    Returns boolean

  • set discreteTrack(v): void
  • Parameters

    • v: boolean

    Returns void

  • get hidePrimaryLabels(): boolean
  • Hides the primary tick labels.

    Returns boolean

  • set hidePrimaryLabels(v): void
  • Parameters

    • v: boolean

    Returns void

  • get hideSecondaryLabels(): boolean
  • Hides the secondary tick labels.

    Returns boolean

  • set hideSecondaryLabels(v): void
  • Parameters

    • v: boolean

    Returns void

  • get hideTooltip(): boolean
  • Hides the thumb tooltip.

    Returns boolean

  • set hideTooltip(v): void
  • Parameters

    • v: boolean

    Returns void

  • get input(): ((s, e) => void)
  • Emitted when a value is changed via thumb drag or keyboard interaction.

    Returns ((s, e) => void)

      • (s, e): void
      • Emitted when a value is changed via thumb drag or keyboard interaction.

        Parameters

        Returns void

  • set input(ev): void
  • Parameters

    Returns void

  • get invalid(): boolean
  • Control the validity of the control.

    Returns boolean

  • set invalid(v): void
  • Parameters

    • v: boolean

    Returns void

  • get locale(): string
  • The locale used to format the thumb and tick label values in the slider.

    Returns string

  • set locale(v): void
  • Parameters

    • v: string

    Returns void

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

    Returns number

  • set lowerBound(v): void
  • Parameters

    • v: number

    Returns void

  • get max(): number
  • 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.

    Returns number

  • set max(v): void
  • Parameters

    • v: number

    Returns void

  • get min(): number
  • 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.

    Returns number

  • set min(v): void
  • Parameters

    • v: number

    Returns void

  • get name(): string
  • The name attribute of the control.

    Returns string

  • set name(v): void
  • Parameters

    • v: string

    Returns void

  • get primaryTicks(): number
  • The number of primary ticks. It defaults to 0 which means no primary ticks are displayed.

    Returns number

  • set primaryTicks(v): void
  • Parameters

    • v: number

    Returns void

  • get secondaryTicks(): number
  • The number of secondary ticks. It defaults to 0 which means no secondary ticks are displayed.

    Returns number

  • set secondaryTicks(v): void
  • Parameters

    • v: number

    Returns void

  • get step(): number
  • 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.

    Returns number

  • set step(v): void
  • Parameters

    • v: number

    Returns void

  • get tickLabelRotation(): TickLabelRotation
  • The degrees for the rotation of the tick labels. Defaults to 0.

    Returns TickLabelRotation

  • set tickLabelRotation(v): void
  • Parameters

    Returns void

  • get tickOrientation(): SliderBaseTickOrientation
  • Changes the orientation of the ticks.

    Returns SliderBaseTickOrientation

  • set tickOrientation(v): void
  • Parameters

    Returns void

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

    Returns number

  • set upperBound(v): void
  • Parameters

    • v: number

    Returns void

  • get value(): number
  • The current value of the component.

    Returns number

  • set value(v): void
  • Parameters

    • v: number

    Returns void

  • get valueFormat(): string
  • String format used for the thumb and tick label values in the slider.

    Returns string

  • set valueFormat(v): void
  • Parameters

    • v: string

    Returns void

  • get valueFormatOptions(): NumberFormatOptions
  • Number format options used for the thumb and tick label values in the slider.

    Returns NumberFormatOptions

  • set valueFormatOptions(v): void
  • Parameters

    • v: NumberFormatOptions

    Returns void

Methods

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

    Returns void

  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    • prevProps: Readonly<IIgrSliderProps>
    • prevState: Readonly<{}>
    • Optional snapshot: any

    Returns void

  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

  • Parameters

    • name: string

    Returns any

  • Parameters

    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns any

  • Returns DOMElement<any, Element>

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

    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

  • Parameters

    • element: any

    Returns void

  • Type parameters

    Type Parameters

    • K extends never

    Parameters

    • state: {} | ((prevState, props) => {} | Pick<{}, K>) | Pick<{}, K>
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • nextProps: any
    • nextState: any

    Returns boolean

  • Decrements the value of the slider by stepDecrement * step, where stepDecrement defaults to 1. stepDecrement Optional step decrement. If no parameter is passed, it defaults to 1.

    Parameters

    • Optional stepDecrement: number
      • 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. stepIncrement Optional step increment. If no parameter is passed, it defaults to 1.

    Parameters

    • Optional stepIncrement: number
      • Optional step increment. If no parameter is passed, it defaults to 1.

    Returns void