Bootstrap

API slider

createSlider

function

createSlider(props?): SliderWidget

Create a Slider with given config props

Parameters

props?: PropsConfig<SliderProps>

Returns

SliderWidget

a SliderWidget


getSliderDefaultConfig

function

getSliderDefaultConfig(): SliderProps

Retrieve a shallow copy of the default Slider config

Returns

SliderProps

the default Slider config


HandleDisplayOptions

interface
Properties
left

left: null | number

Left offset of the handle in %


top

top: null | number

Top offset of the handle in %


PartialSliderProps

type alias

PartialSliderProps: Partial<SliderProps>


ProgressDisplayOptions

interface
Properties
bottom

bottom: null | number

Bottom offset of the progress in %


height

height: number

Height of hte progress in %


left

left: null | number

Right offset of the progress in %


right

right: null | number

Left offset of the progress in %


top

top: null | number

Top offset of the progress in %


width

width: number

Width of the progress in %


SliderActions

interface
Methods
click

click(event): void

Method to handle click on the slider

Parameters

event: MouseEvent

mouse event

Returns

void


keydown

keydown(event, handleNumber): void

Method to process the keyboard event

Parameters

event: KeyboardEvent

keyboard event object

handleNumber: number

id of the modified handle

Returns

void


mouseDown

mouseDown(event, handleId): void

Method describing the behavior of the slider handle on mouse down event

Parameters

event: MouseEvent

mouse event

handleId: number

numeric id of the handle

Returns

void


touchStart

touchStart(event, handleId): void

Method describing the behavior of the slider handle on touch start event

Parameters

event: TouchEvent

touch event

handleId: number

number id of the handle

Returns

void


SliderApi

interface

SliderComponent

class
Implements
Constructors
new SliderComponent

new SliderComponent(): SliderComponent

Returns

SliderComponent

Properties
_widget

readonly _widget: AngularWidget<SliderWidget>


ariaLabelHandle

ariaLabelHandle: undefined | (value, sortedIndex, index) => string

Return the value for the 'aria-label' attribute for the handle

Param

value of the handle

Param

index of the handle in the sorted list

Param

index of the handle in the original list

Default Value
(value: number) => '' + value

ariaValueText

ariaValueText: undefined | (value, sortedIndex, index) => string

Return the value for the 'aria-valuetext' attribute for the handle

Param

value of the handle

Param

index of the handle in the sorted list

Param

index of the handle in the original list

Default Value
(value: number) => '' + value

className

className: undefined | string

CSS classes to be applied on the widget main container

Default Value

''


defaultSlots

readonly defaultSlots: WritableSignal<Partial<SliderProps>, Partial<SliderProps>>


disabled

disabled: undefined | boolean

If true slider value cannot be changed and the slider cannot be focused

Default Value

false


handle

handle: SlotContent<SliderSlotHandleContext>

Slot to change the handlers


label

label: SlotContent<SliderSlotLabelContext>

Slot to change the default labels of the slider

Default Value
({value}: SliderSlotLabelContext) => '' + value

max

max: undefined | number

Maximum value that can be assigned to the slider

Default Value

100


min

min: undefined | number

Minimum value that can be assigned to the slider

Default Value

0


readonly

readonly: undefined | boolean

If true slider value cannot be changed but the slider is still focusable

Default Value

false


rtl

rtl: undefined | boolean

It true slider display is inversed

Default Value

false


showMinMaxLabels

showMinMaxLabels: undefined | boolean

If true the min and max labels are displayed on the slider

Default Value

true


showValueLabels

showValueLabels: undefined | boolean

If true the value labels are displayed on the slider

Default Value

true


slotHandleFromContent

slotHandleFromContent: undefined | SliderHandleDirective


slotLabelFromContent

slotLabelFromContent: undefined | SliderLabelDirective


slotStructureFromContent

slotStructureFromContent: undefined | SliderStructureDirective


stepSize

stepSize: undefined | number

Unit value between slider steps

Default Value

1


structure

structure: SlotContent<SliderContext>

Slot to change the default display of the slider


values

values: undefined | number[]

Current slider values

Default Value

[0]


valuesChange

valuesChange: EventEmitter<number[]>

An event emitted when slider values are changed

Event payload equals to the updated slider values

Default Value
() => {}

vertical

vertical: undefined | boolean

If true is vertically positioned otherwise it is horizontal

Default Value

false

Accessors
api

get api(): W["api"]

Returns

W["api"]


state

get state(): Signal<WidgetState<W>>

Returns

Signal<WidgetState<W>>


widget

get widget(): ContextWidget<W>

Returns

ContextWidget<W>

Methods
handleBlur

handleBlur(): void

Returns

void


ngAfterContentChecked

ngAfterContentChecked(): void

A callback method that is invoked immediately after the default change detector has completed checking all of the directive's content.

Returns

void

Implementation of

AfterContentChecked.ngAfterContentChecked


ngOnChanges

ngOnChanges(changes): void

Parameters

changes: SimpleChanges

Returns

void

Inherit Doc

ngOnInit

ngOnInit(): void

Returns

void

Inherit Doc

onChange

onChange(_): void

Control value accessor methods

Parameters

_: any

Returns

void


onTouched

onTouched(): void

Returns

void


registerOnChange

registerOnChange(fn): void

Parameters

fn

Returns

void


registerOnTouched

registerOnTouched(fn): void

Parameters

fn

Returns

void


setDisabledState

setDisabledState(isDisabled): void

Parameters

isDisabled: boolean

Returns

void


writeValue

writeValue(value): void

Parameters

value: any

Returns

void


SliderContext

type alias

SliderContext: WidgetSlotContext<SliderWidget>


SliderDefaultHandleSlotComponent

class
Constructors
new SliderDefaultHandleSlotComponent

new SliderDefaultHandleSlotComponent(): SliderDefaultHandleSlotComponent

Returns

SliderDefaultHandleSlotComponent

Properties
handle

readonly handle: TemplateRef<SliderSlotHandleContext>

Methods
onKeyDown

onKeyDown(event, handleId, widgetOnKeyDownFn): void

Parameters

event: KeyboardEvent

handleId: number

widgetOnKeyDownFn

Returns

void


sliderDefaultSlotHandle

constant

const sliderDefaultSlotHandle: ComponentTemplate<unknown, "handle", SliderDefaultHandleSlotComponent>


sliderDefaultSlotStructure

constant

const sliderDefaultSlotStructure: ComponentTemplate<unknown, "structure", SliderDefaultStructureSlotComponent>


SliderDefaultStructureSlotComponent

class
Constructors
new SliderDefaultStructureSlotComponent

new SliderDefaultStructureSlotComponent(): SliderDefaultStructureSlotComponent

Returns

SliderDefaultStructureSlotComponent

Properties
structure

structure: TemplateRef<SliderContext>


SliderDirectives

interface
Properties
clickableAreaDirective

clickableAreaDirective: Directive

Directive to apply to the slider clickable area, to directly move the handle to a given specific position


combinedHandleLabelDisplayDirective

combinedHandleLabelDisplayDirective: Directive

Directive to apply to the handle when combined label display is active


handleDirective

handleDirective: Directive<object>

Directive to apply to the slider handle if any

Type declaration
item

item: SliderHandle


handleLabelDisplayDirective

handleLabelDisplayDirective: Directive<object>

Directive to apply to the handle when combined label display is not active

Type declaration
index

index: number


maxLabelDirective

maxLabelDirective: Directive

Directive to get the maxLabel elementRef


minLabelDirective

minLabelDirective: Directive

Directive to get the minLabel elementRef


progressDisplayDirective

progressDisplayDirective: Directive<object>

Directive used to style the progress display for each handle

Type declaration
option

option: ProgressDisplayOptions


sliderDirective

sliderDirective: Directive

Directive to get the slider component elementRef


SliderHandle

interface
Properties
ariaLabel

ariaLabel: string

ariaLabel of the handle


ariaValueText

ariaValueText: string

ariaValueText of the handle


id

id: number

Handle id


value

value: number

Value of the handle


SliderHandleDirective

class
Constructors
new SliderHandleDirective

new SliderHandleDirective(): SliderHandleDirective

Returns

SliderHandleDirective

Properties
templateRef

templateRef: TemplateRef<any>

Methods
ngTemplateContextGuard

static ngTemplateContextGuard(_dir, context): context is SliderSlotHandleContext

Parameters

_dir: SliderHandleDirective

context: unknown

Returns

context is SliderSlotHandleContext


SliderLabelDirective

class
Constructors
new SliderLabelDirective

new SliderLabelDirective(): SliderLabelDirective

Returns

SliderLabelDirective

Properties
templateRef

templateRef: TemplateRef<any>

Methods
ngTemplateContextGuard

static ngTemplateContextGuard(_dir, context): context is SliderSlotLabelContext

Parameters

_dir: SliderLabelDirective

context: unknown

Returns

context is SliderSlotLabelContext


SliderProps

interface
Properties
ariaLabelHandle

ariaLabelHandle: (value, sortedIndex, index) => string

Return the value for the 'aria-label' attribute for the handle

Parameters

value: number

value of the handle

sortedIndex: number

index of the handle in the sorted list

index: number

index of the handle in the original list

Returns

string

Default Value
(value: number) => '' + value

ariaValueText

ariaValueText: (value, sortedIndex, index) => string

Return the value for the 'aria-valuetext' attribute for the handle

Parameters

value: number

value of the handle

sortedIndex: number

index of the handle in the sorted list

index: number

index of the handle in the original list

Returns

string

Default Value
(value: number) => '' + value

className

className: string

CSS classes to be applied on the widget main container

Default Value

''


disabled

disabled: boolean

If true slider value cannot be changed and the slider cannot be focused

Default Value

false


handle

handle: SlotContent<SliderSlotHandleContext>

Slot to change the handlers


label

label: SlotContent<SliderSlotLabelContext>

Slot to change the default labels of the slider

Default Value
({value}: SliderSlotLabelContext) => '' + value

max

max: number

Maximum value that can be assigned to the slider

Default Value

100


min

min: number

Minimum value that can be assigned to the slider

Default Value

0


onValuesChange

onValuesChange: (values) => void

An event emitted when slider values are changed

Event payload equals to the updated slider values

Parameters

values: number[]

Returns

void

Default Value
() => {}

readonly

readonly: boolean

If true slider value cannot be changed but the slider is still focusable

Default Value

false


rtl

rtl: boolean

It true slider display is inversed

Default Value

false


showMinMaxLabels

showMinMaxLabels: boolean

If true the min and max labels are displayed on the slider

Default Value

true


showValueLabels

showValueLabels: boolean

If true the value labels are displayed on the slider

Default Value

true


stepSize

stepSize: number

Unit value between slider steps

Default Value

1


structure

structure: SlotContent<SliderContext>

Slot to change the default display of the slider


values

values: number[]

Current slider values

Default Value

[0]


vertical

vertical: boolean

If true is vertically positioned otherwise it is horizontal

Default Value

false


SliderSlotHandleContext

type alias

SliderSlotHandleContext: SliderContext & object

Type declaration
item

item: SliderHandle


SliderSlotLabelContext

type alias

SliderSlotLabelContext: SliderContext & object

Type declaration
value

value: number


SliderState

interface
Properties
className

className: string

CSS classes to be applied on the widget main container

Default Value

''


combinedLabelDisplay

combinedLabelDisplay: boolean

If true, the label when the handles are close is visible


combinedLabelPositionLeft

combinedLabelPositionLeft: number

Combined label left offset in %


combinedLabelPositionTop

combinedLabelPositionTop: number

Combined label top offset in %


disabled

disabled: boolean

If true slider value cannot be changed and the slider cannot be focused

Default Value

false


handle

handle: SlotContent<SliderSlotHandleContext>

Slot to change the handlers


handleDisplayOptions

handleDisplayOptions: HandleDisplayOptions[]

Array of objects representing handle display options


interactive

interactive: boolean

Check if the slider is interactive, meaning it is not disabled or readonly


label

label: SlotContent<SliderSlotLabelContext>

Slot to change the default labels of the slider

Default Value
({value}: SliderSlotLabelContext) => '' + value

max

max: number

Maximum value that can be assigned to the slider

Default Value

100


maxValueLabelDisplay

maxValueLabelDisplay: boolean

If true, the maximum label will be visible


min

min: number

Minimum value that can be assigned to the slider

Default Value

0


minValueLabelDisplay

minValueLabelDisplay: boolean

If true, the minimum label will be visible


progressDisplayOptions

progressDisplayOptions: ProgressDisplayOptions[]

Array of objects representing progress display options


readonly

readonly: boolean

If true slider value cannot be changed but the slider is still focusable

Default Value

false


rtl

rtl: boolean

It true slider display is inversed

Default Value

false


showMinMaxLabels

showMinMaxLabels: boolean

If true the min and max labels are displayed on the slider

Default Value

true


showValueLabels

showValueLabels: boolean

If true the value labels are displayed on the slider

Default Value

true


sortedHandles

sortedHandles: SliderHandle[]

Array of the sorted handles to display


sortedValues

sortedValues: number[]

Sorted slider values


stepSize

stepSize: number

Unit value between slider steps

Default Value

1


structure

structure: SlotContent<SliderContext>

Slot to change the default display of the slider


values

values: number[]

Current slider values

Default Value

[0]


vertical

vertical: boolean

If true is vertically positioned otherwise it is horizontal

Default Value

false


SliderStructureDirective

class
Constructors
new SliderStructureDirective

new SliderStructureDirective(): SliderStructureDirective

Returns

SliderStructureDirective

Properties
templateRef

templateRef: TemplateRef<any>

Methods
ngTemplateContextGuard

static ngTemplateContextGuard(_dir, context): context is SliderSlotHandleContext

Parameters

_dir: SliderStructureDirective

context: unknown

Returns

context is SliderSlotHandleContext


SliderWidget

type alias

SliderWidget: Widget<SliderProps, SliderState, SliderApi, SliderActions, SliderDirectives>