Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Elements
  • Overview
  • Usage
  • Components Customization
  • Elements
    • Apps Icons
    • Breadcrumb
    • Color Picker
    • Conditional Fields
    • Count Down
    • Filters
    • Infinite Scroll
    • List Tile
    • Loading
    • Map
    • Modal
    • Placeholder
    • Progress Bar
    • Rating Stars
    • Reviews
    • Reviews Summary
    • Sheet
    • Skeleton
    • Slider
    • Social
    • Social Share
    • Tabs
  • Form
    • Button
    • Bottom Alert
    • Contacts
    • Date Time Picker
    • File Upload
    • Menu
    • Quantity Input
    • Select
    • Tel Input
  • Product
    • Add Product
    • Advertisement
    • Comments
    • Conditional Offer
    • Gifting
    • Installment
    • Meta Data
    • Offer
    • Offer Modal
    • Orders
    • Payments
    • Product Availability
    • Product Card
    • Products List
    • Product Options
    • Product Size Guide
    • Products Slider
    • Quick Buy
    • Quick Order
    • Scopes
    • Search
  • User
    • Cart Summary
    • Localization
    • Login
    • Loyalty
    • Rating
    • User Menu
    • User Profile
    • User Settings
    • Verify
  1. Elements

Slider

The <salla-slider> component allows you to create a slider that can display multiple slides, which can be navigated by the Merchant using arrows or thumbnails.
Slider

Usage#

HTML
SASS

Properties#

PropertyAttributeDescriptionTypeDefault
Arrows Centeredarrows-centeredWhether or not to center the slider's arrowsbooleanfalse
Auto Heightauto-heightWhether or not to auto the height of the sliderbooleanfalse
Auto Playauto-playWhether or not to enable autoplay, which only works with the following: type="carousel" onlybooleanfalse
Block Subtitleblock-subtitleWhether or not to show the slider's block sub titlestring''
Block Titleblock-titleWhether or not to show the slider's block titlestring''
CenteredcenteredWhether or not to enable the center mode, which only works with type="carousel" onlybooleanfalse
Controls Outercontrols-outerWhether or not to show arrow controls on the outerside of the sliderbooleanfalse
DirectiondirectionThe slider's direction, which is defaulted to: document.documentElement.dirstringundefined
Display All Urldisplay-all-urlWhether or not to display all button beside arrowsstring''
Grid Thumbsgrid-thumbsWhether or not to disable the thumbs slider and rather show it as a gridbooleanfalse
Listen To Thumbnails Optionlisten-to-thumbnails-optionWhether or not to enable the calling of a specific slide by index from thumbnails option in the salla-slider-options component, which only works if data-img-id and data-slid-index attributes are set on each slidebooleanfalse
LooploopRun the slider in loop. It is recommended not to use it for slides with custom components inside of it, because that may cause some re-rendering issuesbooleanfalse
PaginationpaginationWhether or not to enable slide pagination.
Pagination will not be displayed unless the slider has an ID
booleanfalse
Show Controlsshow-controlsWhether or not to show slider arrow controlsbooleantrue
Show Thumbs Controlsshow-thumbs-controlsWhether or not to show thumbs slider controlsbooleantrue
Slider Configslider-configSet the slider's configurations. Refer to https://swiperjs.com/swiper-api#parameters and pass the entire config objectanyundefined
Slides Per Viewslides-per-viewShow slides per view based on the user's interactivity with the slidesstring"auto"
Thumbs Configthumbs-configSet thumbs slider configurations Refer to https://swiperjs.com/swiper-api#parameters and pass the entire config objectanyundefined
TypetypeSet the type of the slider, which is defaulted to: ''"" | "blog" | "carousel" | "default" | "fullscreen" | "fullwidth" | "hero" | "testimonials" | "thumbs"''
VerticalverticalAlign the main slider in either vertical or horizontal modebooleanfalse
Vertical Thumbsvertical-thumbsAlign the thumbs slider in either vertical or horizontal modebooleanfalse

Events#

EventDescriptionType
afterInitThis event will be fired when the Slider is initialized immediately.CustomEvent<any>
reachBeginningThis event will be fired when the Slider reaches its beginning (initial position)CustomEvent<any>
reachEndThis event will be fired when Slider reaches last slideCustomEvent<any>
slideChangeThis event will be fired when currently active slide is changedCustomEvent<any>
slideChangeTransitionStartThis event will be fired when the animation starts to transition (either to the next or from the previous slide).CustomEvent<any>
slideChangeTransitionEndThis event will be fired when the animation ends its transition (either to the next or from the previous slide).CustomEvent<any>
slideNextTransitionStartThis event will be fired when the slide animation's transition starts onto the next slide.CustomEvent<any>
slideNextTransitionEndThis event will be fired when the slide animation's transition ends onto the next slide.CustomEvent<any>
slidePrevTransitionStartThis event will be fired when the slide animation's transition ends onto the previous slide.CustomEvent<any>
slidePrevTransitionEndThis event will be fired when the slide animation's transition starts onto the previous slide.CustomEvent<any>
sliderMoveThis event will be fired when the user touches and moves the mouse pointer the slider and interacts with it.CustomEvent<any>
sliderTransitionEndThis event will be fired after the transition ends.CustomEvent<any>
sliderTransitionStartThis event will be fired in the beginning of the transition.CustomEvent<any>
touchSliderEndThis event will be fired when the slider's mouse pointer is released from the Slider.CustomEvent<any>
touchSliderMoveThis event will be fired when the slider's mouse pointer touches moves over the Slider.CustomEvent<any>
touchSliderStartThis event will be fired when the slider's mouse pointer touches the Slider.CustomEvent<any>

Methods#

The pre-defined methods allow for calling functions built by Salla to carry out certain actvities, such as getSlides which gets all of the slider slides.
MethodDescriptionReturn Type
getSlides()Gets all of the slider's slidesPromise<any>
slideNext(speed?: number, runCallbacks?: boolean)Runs a transition to the next slide.Promise<void>
slideNextLoop(speed?: number, runCallbacks?: boolean)Runs a transition to the next slide in an enabled looped condition.Promise<void>
slidePrev(speed?: number, runCallbacks?: boolean)Runs a transition to the previous slide.Promise<void>
slidePrevLoop(speed?: number, runCallbacks?: boolean)Runs a transition to the previous slide in an enabled looped condition.Promise<void>
slideReset(speed?: number, runCallbacks?: boolean)Resets the slider position to the currently active slide for the duration equal to the speed parameter.Promise<void>
slideTo(index: number, speed?: number, runCallbacks?: boolean)Runs a transition to the slide with the index number equal to the index parameter for the duration equal to speed parameter.Promise<any>
slideToClosest(speed?: number, runCallbacks?: boolean)Resets the slider position to the closest slide / snap point for the duration equal to the speed parameter.Promise<void>
slideToLoop(index: number, speed?: number, runCallbacks?: boolean)Runs a looped condition transition to the slide with the index number equal to the index parameter for the duration equal to speed parameterPromise<void>
update()Either call this method after adding / removing or showing / hiding the slides manually. Also, any custom DOM modification has to have this method called upon the update.Promise<void>
updateAutoHeight(speed?: number)Forces the slider to update its height, when autoHeight enabled, for the duration equal to the speed parameter.Promise<void>
updateProgress()Recalculates the slider's progress.Promise<void>
updateSlides()Recalculates the number of slides and their offsets. Useful after adding / removing slides with JavaScriptPromise<void>
updateSlidesClasses()Updates active / prev / next classes on the slides and bulletsPromise<void>

Slots#

Theslots makes it customizable to modify certain labels, such as items.
SlotDescription
itemsCustomizing the Slider items.
thumbsCustomizing the Thumbs' slider items.
Modified at 2024-08-28 14:45:56
Previous
Skeleton
Next
Social