swiper-options.d.ts 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223
  1. import { A11yOptions } from './modules/a11y';
  2. import { AutoplayOptions } from './modules/autoplay';
  3. import { ControllerOptions } from './modules/controller';
  4. import { CoverflowEffectOptions } from './modules/effect-coverflow';
  5. import { CubeEffectOptions } from './modules/effect-cube';
  6. import { FadeEffectOptions } from './modules/effect-fade';
  7. import { FlipEffectOptions } from './modules/effect-flip';
  8. import { CreativeEffectOptions } from './modules/effect-creative';
  9. import { CardsEffectOptions } from './modules/effect-cards';
  10. import { HashNavigationOptions } from './modules/hash-navigation';
  11. import { HistoryOptions } from './modules/history';
  12. import { KeyboardOptions } from './modules/keyboard';
  13. import { LazyOptions } from './modules/lazy';
  14. import { MousewheelOptions } from './modules/mousewheel';
  15. import { NavigationOptions } from './modules/navigation';
  16. import { PaginationOptions } from './modules/pagination';
  17. import { ParallaxOptions } from './modules/parallax';
  18. import { ScrollbarOptions } from './modules/scrollbar';
  19. import { ThumbsOptions } from './modules/thumbs';
  20. import { VirtualOptions } from './modules/virtual';
  21. import { ZoomOptions } from './modules/zoom';
  22. import { FreeModeOptions } from './modules/free-mode';
  23. import { GridOptions } from './modules/grid';
  24. import { CSSSelector, SwiperModule } from './shared';
  25. import { SwiperEvents } from './swiper-events';
  26. export interface SwiperOptions {
  27. /**
  28. * Array with Swiper modules
  29. *
  30. * @example
  31. * ```js
  32. * import Swiper, { Navigation, Pagination } from 'swiper';
  33. *
  34. * const swiper = new Swiper('.swiper', {
  35. * modules: [ Navigation, Pagination ],
  36. * });
  37. * ```
  38. */
  39. modules?: SwiperModule[];
  40. /**
  41. * Whether Swiper should be initialised automatically when you create an instance.
  42. * If disabled, then you need to init it manually by calling `swiper.init()`
  43. *
  44. * @default true
  45. */
  46. init?: boolean;
  47. /**
  48. * Whether Swiper initially enabled. When Swiper is disabled, it will hide all navigation elements and won't respond to any events and interactions
  49. *
  50. * @default true
  51. */
  52. enabled?: boolean;
  53. /**
  54. * Swiper will recalculate slides position on window resize (orientationchange)
  55. *
  56. * @default true
  57. */
  58. updateOnWindowResize?: boolean;
  59. /**
  60. * When enabled it will use ResizeObserver (if supported by browser) on swiper container to detect container resize (instead of watching for window resize)
  61. *
  62. * @default true
  63. */
  64. resizeObserver?: boolean;
  65. /**
  66. * Index number of initial slide.
  67. *
  68. * @default 0
  69. */
  70. initialSlide?: number;
  71. /**
  72. * Can be `'horizontal'` or `'vertical'` (for vertical slider).
  73. *
  74. * @default 'horizontal'
  75. */
  76. direction?: 'horizontal' | 'vertical';
  77. /**
  78. * Duration of transition between slides (in ms)
  79. *
  80. * @default 300
  81. */
  82. speed?: number;
  83. /**
  84. * Enabled this option and plugin will set width/height on swiper wrapper equal to total size of all slides.
  85. * Mostly should be used as compatibility fallback option for browser that don't support flexbox layout well
  86. *
  87. * @default false
  88. */
  89. setWrapperSize?: boolean;
  90. /**
  91. * Enabled this option and swiper will be operated as usual except it will not move, real translate values on wrapper will not be set.
  92. * Useful when you may need to create custom slide transition
  93. *
  94. * @default false
  95. */
  96. virtualTranslate?: boolean;
  97. /**
  98. * Swiper width (in px). Parameter allows to force Swiper width.
  99. * Useful only if you initialize Swiper when it is hidden and in SSR and Test environments for correct Swiper initialization
  100. *
  101. * @default null
  102. *
  103. * @note Setting this parameter will make Swiper not responsive
  104. */
  105. width?: number | null;
  106. /**
  107. * Swiper height (in px). Parameter allows to force Swiper height.
  108. * Useful only if you initialize Swiper when it is hidden and in SSR and Test environments for correct Swiper initialization
  109. *
  110. * @default null
  111. *
  112. * @note Setting this parameter will make Swiper not responsive
  113. */
  114. height?: number | null;
  115. /**
  116. * Set to `true` and slider wrapper will adapt its height to the height of the currently active slide
  117. *
  118. * @default false
  119. */
  120. autoHeight?: boolean;
  121. /**
  122. * Set to `true` to round values of slides width and height to prevent blurry texts on usual
  123. * resolution screens (if you have such)
  124. *
  125. * @default false
  126. */
  127. roundLengths?: boolean;
  128. /**
  129. * Set to `true` on Swiper for correct touch events interception. Use only on
  130. * swipers that use same direction as the parent one
  131. *
  132. * @default false
  133. */
  134. nested?: boolean;
  135. /**
  136. * When enabled Swiper will automatically wrap slides with swiper-wrapper element,
  137. * and will create required elements for navigation, pagination and scrollbar
  138. * they are enabled (with their respective params object or with boolean `true`))
  139. *
  140. * @default false
  141. */
  142. createElements?: boolean;
  143. /**
  144. * CSS selector for focusable elements. Swiping will be disabled on such elements if they are "focused"
  145. *
  146. * @default 'input, select, option, textarea, button, video, label'
  147. */
  148. focusableElements?: string;
  149. /**
  150. * If enabled (by default) and navigation elements' parameters passed as a string (like `".pagination"`)
  151. * then Swiper will look for such elements through child elements first.
  152. * Applies for pagination, prev/next buttons and scrollbar elements
  153. *
  154. * @default true
  155. */
  156. uniqueNavElements?: boolean;
  157. /**
  158. * Transition effect. Can be `'slide'`, `'fade'`, `'cube'`, `'coverflow'`, `'flip'` or `'creative'`
  159. *
  160. * @default 'slide'
  161. */
  162. effect?: 'slide' | 'fade' | 'cube' | 'coverflow' | 'flip' | 'creative' | 'cards';
  163. /**
  164. * Fire Transition/SlideChange/Start/End events on swiper initialization.
  165. * Such events will be fired on initialization in case of your initialSlide is not 0, or you use loop mode
  166. *
  167. * @default true
  168. */
  169. runCallbacksOnInit?: boolean;
  170. /**
  171. * When enabled Swiper will be disabled and hide navigation buttons on
  172. * case there are not enough slides for sliding.
  173. *
  174. * @default true
  175. */
  176. watchOverflow?: boolean;
  177. /**
  178. * userAgent string. Required for browser/device detection when rendered on server-side
  179. *
  180. * @default null
  181. */
  182. userAgent?: string | null;
  183. /**
  184. * Required for active slide detection when rendered on server-side and enabled history
  185. *
  186. * @default null
  187. */
  188. url?: string | null;
  189. /**
  190. * Register event handlers
  191. */
  192. on?: {
  193. [event in keyof SwiperEvents]?: SwiperEvents[event];
  194. };
  195. /**
  196. * Add event listener that will be fired on all events
  197. *
  198. * @example
  199. * ```js
  200. * const swiper = new Swiper('.swiper', {
  201. * onAny(eventName, ...args) {
  202. * console.log('Event: ', eventName);
  203. * console.log('Event data: ', args);
  204. * }
  205. * });
  206. * ```
  207. */
  208. onAny?(handler: (eventName: string, ...args: any[]) => void): void;
  209. /**
  210. * When enabled it will use modern CSS Scroll Snap API.
  211. * It doesn't support all of Swiper's features, but potentially should bring a much better performance in simple configurations.
  212. *
  213. * This is what is not supported when it is enabled:
  214. *
  215. * - Cube and Cards effects
  216. * - `speed` parameter may not have no effect
  217. * - All transition start/end related events (use `slideChange` instead)
  218. * - `slidesPerGroup` has limited support
  219. * - `simulateTouch` doesn't have effect and "dragging" with mouse doesn't work
  220. * - `resistance` doesn't have any effect
  221. * - `allowSlidePrev/Next`
  222. * - `swipeHandler`
  223. * - `freeMode` and all relevant features
  224. *
  225. * @default false
  226. */
  227. cssMode?: boolean;
  228. // Slides grid
  229. /**
  230. * Distance between slides in px.
  231. *
  232. * @default 0
  233. *
  234. * @note If you use "margin" css property to the elements which go into Swiper in which you pass "spaceBetween" into, navigation might not work properly.
  235. */
  236. spaceBetween?: number;
  237. /**
  238. * Number of slides per view (slides visible at the same time on slider's container).
  239. * @note If you use it with "auto" value and along with `loop: true` then you need to specify `loopedSlides` parameter with amount of slides to loop (duplicate)
  240. * @note `slidesPerView: 'auto'` is currently not compatible with multirow mode, when `grid.rows` > 1
  241. *
  242. * @default 1
  243. */
  244. slidesPerView?: number | 'auto';
  245. /**
  246. * If total number of slides less than specified here value, then Swiper will enable `backface-visibility: hidden` on slide elements to reduce visual "flicker" in Safari.
  247. *
  248. * @note It is not recommended to enable it on large amount of slides as it will reduce performance
  249. *
  250. * @default 10
  251. */
  252. maxBackfaceHiddenSlides?: number;
  253. /**
  254. * Set numbers of slides to define and enable group sliding. Useful to use with slidesPerView > 1
  255. *
  256. * @default 1
  257. */
  258. slidesPerGroup?: number;
  259. /**
  260. * The parameter works in the following way: If `slidesPerGroupSkip` equals `0` (default), no slides are excluded from grouping, and the resulting behaviour is the same as without this change.
  261. *
  262. * If `slidesPerGroupSkip` is equal or greater than `1` the first X slides are treated as single groups, whereas all following slides are grouped by the `slidesPerGroup` value.
  263. *
  264. * @default 0
  265. */
  266. slidesPerGroupSkip?: number;
  267. /**
  268. * This param intended to be used only with `slidesPerView: 'auto'` and `slidesPerGroup: 1`. When enabled, it will skip all slides in view on `.slideNext()` & `.slidePrev()` methods calls, on Navigation "buttons" clicks and in autoplay.
  269. *
  270. * @default false
  271. */
  272. slidesPerGroupAuto?: boolean;
  273. /**
  274. * If `true`, then active slide will be centered, not always on the left side.
  275. *
  276. * @default false
  277. */
  278. centeredSlides?: boolean;
  279. /**
  280. * If `true`, then active slide will be centered without adding gaps at the beginning and end of slider.
  281. * Required `centeredSlides: true`. Not intended to be used with `loop` or `pagination`
  282. *
  283. * @default false
  284. */
  285. centeredSlidesBounds?: boolean;
  286. /**
  287. * Add (in px) additional slide offset in the beginning of the container (before all slides)
  288. *
  289. * @default 0
  290. */
  291. slidesOffsetBefore?: number;
  292. /**
  293. * Add (in px) additional slide offset in the end of the container (after all slides)
  294. *
  295. * @default 0
  296. */
  297. slidesOffsetAfter?: number;
  298. /**
  299. * Normalize slide index.
  300. *
  301. * @default true
  302. */
  303. normalizeSlideIndex?: boolean;
  304. /**
  305. * When enabled it center slides if the amount of slides less than `slidesPerView`. Not intended to be used `loop` mode and `grid.rows`
  306. *
  307. * @default false
  308. */
  309. centerInsufficientSlides?: boolean;
  310. /**
  311. * This option may a little improve desktop usability. If `true`, user will see the "grab" cursor when hover on Swiper
  312. *
  313. * @default false
  314. */
  315. grabCursor?: boolean;
  316. /**
  317. * Target element to listen touch events on. Can be `'container'` (to listen for touch events on swiper) or `'wrapper'`
  318. * (to listen for touch events on swiper-wrapper)
  319. *
  320. * @default 'wrapper'
  321. */
  322. touchEventsTarget?: 'container' | 'wrapper';
  323. /**
  324. * Touch ratio
  325. *
  326. * @default 1
  327. */
  328. touchRatio?: number;
  329. /**
  330. * Allowable angle (in degrees) to trigger touch move
  331. *
  332. * @default 45
  333. */
  334. touchAngle?: number;
  335. /**
  336. * If `true`, Swiper will accept mouse events like touch events (click and drag to change slides)
  337. *
  338. * @default true
  339. */
  340. simulateTouch?: boolean;
  341. /**
  342. * Set to `false` if you want to disable short swipes
  343. *
  344. * @default true
  345. */
  346. shortSwipes?: boolean;
  347. /**
  348. * Set to `false` if you want to disable long swipes
  349. *
  350. * @default true
  351. */
  352. longSwipes?: boolean;
  353. /**
  354. * Ratio to trigger swipe to next/previous slide during long swipes
  355. *
  356. * @default 0.5
  357. */
  358. longSwipesRatio?: number;
  359. /**
  360. * Minimal duration (in ms) to trigger swipe to next/previous slide during long swipes
  361. *
  362. * @default 300
  363. */
  364. longSwipesMs?: number;
  365. /**
  366. * If disabled, then slider will be animated only when you release it, it will not move while you hold your finger on it
  367. *
  368. * @default true
  369. */
  370. followFinger?: boolean;
  371. /**
  372. * If `false`, then the only way to switch the slide is use of external API functions like slidePrev or slideNext
  373. *
  374. * @default true
  375. */
  376. allowTouchMove?: boolean;
  377. /**
  378. * Threshold value in px. If "touch distance" will be lower than this value then swiper will not move
  379. *
  380. * @default 0
  381. */
  382. threshold?: number;
  383. /**
  384. * If disabled, `touchstart` (`pointerdown`) event won't be prevented
  385. *
  386. * @default true
  387. */
  388. touchStartPreventDefault?: boolean;
  389. /**
  390. * Force to always prevent default for `touchstart` (`pointerdown`) event
  391. *
  392. * @default false
  393. */
  394. touchStartForcePreventDefault?: boolean;
  395. /**
  396. * If enabled, then propagation of "touchmove" will be stopped
  397. *
  398. * @default false
  399. */
  400. touchMoveStopPropagation?: boolean;
  401. /**
  402. * Enable to release Swiper events for swipe-back work in app. If set to `'prevent'` then it will prevent system swipe-back navigation instead
  403. *
  404. * @default false
  405. */
  406. edgeSwipeDetection?: boolean | string;
  407. /**
  408. * Area (in px) from left edge of the screen to release touch events for swipe-back in app
  409. *
  410. * @default 20
  411. */
  412. edgeSwipeThreshold?: number;
  413. /**
  414. * Enable to release touch events on slider edge position (beginning, end) to allow for further page scrolling
  415. *
  416. * @default false
  417. */
  418. touchReleaseOnEdges?: boolean;
  419. /**
  420. * Passive event listeners will be used by default where possible to improve scrolling performance on mobile devices.
  421. * But if you need to use `e.preventDefault` and you have conflict with it, then you should disable this parameter
  422. *
  423. * @default true
  424. */
  425. passiveListeners?: boolean;
  426. // Touch Resistance
  427. /**
  428. * Set to `false` if you want to disable resistant bounds
  429. *
  430. * @default true
  431. */
  432. resistance?: boolean;
  433. /**
  434. * This option allows you to control resistance ratio
  435. *
  436. * @default 0.85
  437. */
  438. resistanceRatio?: number;
  439. // Swiping / No swiping
  440. /**
  441. * When enabled it won't allow to change slides by swiping or navigation/pagination buttons during transition
  442. *
  443. * @default false
  444. */
  445. preventInteractionOnTransition?: boolean;
  446. /**
  447. * Set to `false` to disable swiping to previous slide direction (to left or top)
  448. *
  449. * @default true
  450. */
  451. allowSlidePrev?: boolean;
  452. /**
  453. * Set to `false` to disable swiping to next slide direction (to right or bottom)
  454. *
  455. * @default true
  456. */
  457. allowSlideNext?: boolean;
  458. /**
  459. * Enable/disable swiping on elements matched to class specified in `noSwipingClass`
  460. *
  461. * @default true
  462. */
  463. noSwiping?: boolean;
  464. /**
  465. * Specify `noSwiping`'s element css class
  466. *
  467. * @default 'swiper-no-swiping'
  468. */
  469. noSwipingClass?: string;
  470. /**
  471. * Can be used instead of `noSwipingClass` to specify elements to disable swiping on.
  472. * For example `'input'` will disable swiping on all inputs
  473. *
  474. * @default
  475. */
  476. noSwipingSelector?: string;
  477. /**
  478. * String with CSS selector or HTML element of the container with pagination that will work as only available handler for swiping
  479. *
  480. * @default null
  481. */
  482. swipeHandler?: CSSSelector | HTMLElement | null;
  483. // Clicks
  484. /**
  485. * Set to `true` to prevent accidental unwanted clicks on links during swiping
  486. *
  487. * @default true
  488. */
  489. preventClicks?: boolean;
  490. /**
  491. * Set to `true` to stop clicks event propagation on links during swiping
  492. *
  493. * @default true
  494. */
  495. preventClicksPropagation?: boolean;
  496. /**
  497. * Set to `true` and click on any slide will produce transition to this slide
  498. *
  499. * @default false
  500. */
  501. slideToClickedSlide?: boolean;
  502. // Progress
  503. /**
  504. * Enable this feature to calculate each slides progress and visibility (slides in viewport will have additional visible class)
  505. *
  506. * @default false
  507. */
  508. watchSlidesProgress?: boolean;
  509. // Images
  510. /**
  511. * When enabled Swiper will force to load all images
  512. *
  513. * @default true
  514. */
  515. preloadImages?: boolean;
  516. /**
  517. * When enabled Swiper will be reinitialized after all inner images (<img> tags) are loaded. Required `preloadImages: true`
  518. *
  519. * @default true
  520. */
  521. updateOnImagesReady?: boolean;
  522. /**
  523. * Set to `true` to enable continuous loop mode
  524. *
  525. * Because of nature of how the loop mode works, it will add duplicated slides. Such duplicated slides will have additional classes:
  526. * - `swiper-slide-duplicate` - represents duplicated slide
  527. * - `swiper-slide-duplicate-active` - represents slide duplicated to the currently active slide
  528. * - `swiper-slide-duplicate-next` - represents slide duplicated to the slide next to active
  529. * - `swiper-slide-duplicate-prev` - represents slide duplicated to the slide previous to active
  530. *
  531. * @default false
  532. *
  533. * @note If you use it along with `slidesPerView: 'auto'` then you need to specify `loopedSlides` parameter with amount of slides to loop (duplicate). Should not be used together with `rewind` mode
  534. */
  535. loop?: boolean;
  536. /**
  537. * Set to `true` to enable "rewind" mode. When enabled, clicking "next" navigation button (or calling `.slideNext()`) when on last slide will slide back to the first slide. Clicking "prev" navigation button (or calling `.slidePrev()`) when on first slide will slide forward to the last slide.
  538. *
  539. * @default false
  540. *
  541. * @note Should not be used together with `loop` mode
  542. */
  543. rewind?: boolean;
  544. /**
  545. * Addition number of slides that will be cloned after creating of loop
  546. *
  547. * @default 0
  548. */
  549. loopAdditionalSlides?: number;
  550. /**
  551. * If you use `slidesPerView:'auto'` with loop mode you should tell to Swiper how many slides it should loop (duplicate) using this parameter
  552. *
  553. * @default null
  554. */
  555. loopedSlides?: number | null;
  556. /**
  557. * Enable and loop mode will fill groups with insufficient number of slides with blank slides. Good to be used with `slidesPerGroup` parameter
  558. *
  559. * @default false
  560. */
  561. loopFillGroupWithBlank?: boolean;
  562. /**
  563. * When enabled it prevents Swiper slide prev/next transitions when transitions is already in progress (has effect when `loop` enabled)
  564. *
  565. * @default true
  566. */
  567. loopPreventsSlide?: boolean;
  568. /**
  569. * Allows to set different parameter for different responsive breakpoints (screen sizes). Not all parameters can be changed in breakpoints, only those which are not required different layout and logic, like `slidesPerView`, `slidesPerGroup`, `spaceBetween`, `grid.rows`. Such parameters like `loop` and `effect` won't work
  570. *
  571. * @example
  572. * ```js
  573. * const swiper = new Swiper('.swiper', {
  574. * // Default parameters
  575. * slidesPerView: 1,
  576. * spaceBetween: 10,
  577. * // Responsive breakpoints
  578. * breakpoints: {
  579. * // when window width is >= 320px
  580. * 320: {
  581. * slidesPerView: 2,
  582. * spaceBetween: 20
  583. * },
  584. * // when window width is >= 480px
  585. * 480: {
  586. * slidesPerView: 3,
  587. * spaceBetween: 30
  588. * },
  589. * // when window width is >= 640px
  590. * 640: {
  591. * slidesPerView: 4,
  592. * spaceBetween: 40
  593. * }
  594. * }
  595. * })
  596. * ```
  597. *
  598. * @example
  599. * ```js
  600. * const swiper = new Swiper('.swiper', {
  601. * slidesPerView: 1,
  602. * spaceBetween: 10,
  603. * // using "ratio" endpoints
  604. * breakpoints: {
  605. * '@0.75': {
  606. * slidesPerView: 2,
  607. * spaceBetween: 20,
  608. * },
  609. * '@1.00': {
  610. * slidesPerView: 3,
  611. * spaceBetween: 40,
  612. * },
  613. * '@1.50': {
  614. * slidesPerView: 4,
  615. * spaceBetween: 50,
  616. * },
  617. * }
  618. * });
  619. * ```
  620. */
  621. breakpoints?: {
  622. [width: number]: SwiperOptions;
  623. [ratio: string]: SwiperOptions;
  624. };
  625. /**
  626. * Base for breakpoints (beta). Can be `window` or `container`. If set to `window` (by default) then breakpoint keys mean window width. If set to `container` then breakpoint keys treated as swiper container width
  627. *
  628. * @default 'window'
  629. *
  630. * @note Currently in beta and not supported by Swiper Angular, React, Svelte and Vue components
  631. */
  632. breakpointsBase?: string;
  633. // Observer
  634. /**
  635. * Set to `true` to enable Mutation Observer on Swiper and its elements. In this case Swiper will be updated (reinitialized) each time if you change its style (like hide/show) or modify its child elements (like adding/removing slides)
  636. *
  637. * @default false
  638. */
  639. observer?: boolean;
  640. /**
  641. * Set to `true` if you also need to watch Mutations for Swiper slide children elements
  642. *
  643. * @default false
  644. */
  645. observeSlideChildren?: boolean;
  646. /**
  647. * Set to `true` if you also need to watch Mutations for Swiper parent elements
  648. *
  649. * @default false
  650. */
  651. observeParents?: boolean;
  652. // Namespace
  653. /**
  654. * The beginning of the modifier CSS class that can be added to swiper container depending on different parameters
  655. *
  656. * @default 'swiper-'
  657. */
  658. containerModifierClass?: string;
  659. /**
  660. * CSS class name of slide
  661. *
  662. * @default 'swiper-slide'
  663. *
  664. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  665. *
  666. * @note Not supported in Swiper Angular/React/Svelte/Vue components
  667. */
  668. slideClass?: string;
  669. /**
  670. * CSS class name of currently active slide
  671. *
  672. * @default 'swiper-slide-active'
  673. *
  674. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  675. *
  676. * @note Not supported in Swiper Angular/React/Svelte/Vue components
  677. */
  678. slideActiveClass?: string;
  679. /**
  680. * CSS class name of duplicated slide which represents the currently active slide
  681. *
  682. * @default 'swiper-slide-duplicate-active'
  683. *
  684. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  685. *
  686. * @note Not supported in Swiper Angular/React/Svelte/Vue components
  687. */
  688. slideDuplicateActiveClass?: string;
  689. /**
  690. * CSS class name of currently visible slide
  691. *
  692. * @default 'swiper-slide-visible'
  693. *
  694. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  695. *
  696. * @note Not supported in Swiper Angular/React/Svelte/Vue
  697. */
  698. slideVisibleClass?: string;
  699. /**
  700. * CSS class name of slide duplicated by loop mode
  701. *
  702. * @default 'swiper-slide-duplicate'
  703. *
  704. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  705. *
  706. * @note Not supported in Swiper Angular/React/Svelte/Vue
  707. */
  708. slideDuplicateClass?: string;
  709. /**
  710. * CSS class name of slide which is right after currently active slide
  711. *
  712. * @default 'swiper-slide-next'
  713. *
  714. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  715. *
  716. * @note Not supported in Swiper Angular/React/Svelte/Vue
  717. */
  718. slideNextClass?: string;
  719. /**
  720. * CSS class name of duplicated slide which represents the slide next to active slide
  721. *
  722. * @default 'swiper-slide-duplicate-next'
  723. *
  724. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  725. *
  726. * @note Not supported in Swiper Angular/React/Svelte/Vue
  727. */
  728. slideDuplicateNextClass?: string;
  729. /**
  730. * CSS class name of slide which is right before currently active slide
  731. *
  732. * @default 'swiper-slide-prev'
  733. *
  734. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  735. *
  736. * @note Not supported in Swiper Angular/React/Svelte/Vue
  737. */
  738. slidePrevClass?: string;
  739. /**
  740. * CSS class name of duplicated slide which represents the slide previous to active slide
  741. *
  742. * @default 'swiper-slide-duplicate-prev'
  743. *
  744. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  745. *
  746. * @note Not supported in Swiper Angular/React/Svelte/Vue
  747. */
  748. slideDuplicatePrevClass?: string;
  749. /**
  750. * CSS class name of blank slide append to fill groups in loop mode when `loopFillGroupWithBlank` is also enabled
  751. *
  752. * @default 'swiper-slide-invisible-blank'
  753. *
  754. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  755. *
  756. * @note Not supported in Swiper Angular/React/Svelte/Vue
  757. */
  758. slideBlankClass?: string;
  759. /**
  760. * CSS class name of slides' wrapper
  761. *
  762. * @default 'swiper-wrapper'
  763. *
  764. * @note By changing classes you will also need to change Swiper's CSS to reflect changed classes
  765. *
  766. * @note Not supported in Swiper Angular/React/Svelte/Vue
  767. *
  768. */
  769. wrapperClass?: string;
  770. /**
  771. * Object with a11y parameters or boolean `true` to enable with default settings.
  772. *
  773. * @example
  774. * ```js
  775. * const swiper = new Swiper('.swiper', {
  776. * a11y: {
  777. * prevSlideMessage: 'Previous slide',
  778. * nextSlideMessage: 'Next slide',
  779. * },
  780. * });
  781. * ```
  782. */
  783. a11y?: A11yOptions;
  784. /**
  785. * Object with autoplay parameters or boolean `true` to enable with default settings
  786. *
  787. * @example
  788. * ```js
  789. * const swiper = new Swiper('.swiper', {
  790. * autoplay: {
  791. * delay: 5000,
  792. * },
  793. *});
  794. * ```
  795. */
  796. autoplay?: AutoplayOptions | boolean;
  797. /**
  798. * Object with controller parameters or boolean `true` to enable with default settings
  799. *
  800. * @example
  801. * ```js
  802. * const swiper = new Swiper('.swiper', {
  803. * controller: {
  804. * inverse: true,
  805. * },
  806. * });
  807. * ```
  808. */
  809. controller?: ControllerOptions;
  810. /**
  811. * Object with Coverflow-effect parameters.
  812. *
  813. * @example
  814. * ```js
  815. * const swiper = new Swiper('.swiper', {
  816. * effect: 'coverflow',
  817. * coverflowEffect: {
  818. * rotate: 30,
  819. * slideShadows: false,
  820. * },
  821. * });
  822. * ```
  823. */
  824. coverflowEffect?: CoverflowEffectOptions;
  825. /**
  826. * Object with Cube-effect parameters
  827. *
  828. * @example
  829. * ```js
  830. * const swiper = new Swiper('.swiper', {
  831. * effect: 'cube',
  832. * cubeEffect: {
  833. * slideShadows: false,
  834. * },
  835. * });
  836. * ```
  837. */
  838. cubeEffect?: CubeEffectOptions;
  839. /**
  840. * Object with Fade-effect parameters
  841. *
  842. * @example
  843. * ```js
  844. * const swiper = new Swiper('.swiper', {
  845. * effect: 'fade',
  846. * fadeEffect: {
  847. * crossFade: true
  848. * },
  849. * });
  850. * ```
  851. */
  852. fadeEffect?: FadeEffectOptions;
  853. /**
  854. * Object with Flip-effect parameters
  855. *
  856. * @example
  857. * ```js
  858. * const swiper = new Swiper('.swiper', {
  859. * effect: 'flip',
  860. * flipEffect: {
  861. * slideShadows: false,
  862. * },
  863. * });
  864. * ```
  865. */
  866. flipEffect?: FlipEffectOptions;
  867. /**
  868. * Object with Creative-effect parameters
  869. *
  870. * @example
  871. * ```js
  872. * const swiper = new Swiper('.swiper', {
  873. * effect: 'creative',
  874. * creativeEffect: {
  875. * prev: {
  876. * // will set `translateZ(-400px)` on previous slides
  877. * translate: [0, 0, -400],
  878. * },
  879. * next: {
  880. * // will set `translateX(100%)` on next slides
  881. * translate: ['100%', 0, 0],
  882. * },
  883. * },
  884. * });
  885. * ```
  886. */
  887. creativeEffect?: CreativeEffectOptions;
  888. /**
  889. * Object with Cards-effect parameters
  890. *
  891. * @example
  892. * ```js
  893. * const swiper = new Swiper('.swiper', {
  894. * effect: 'cards',
  895. * cardsEffect: {
  896. * // ...
  897. * },
  898. * });
  899. * ```
  900. */
  901. cardsEffect?: CardsEffectOptions;
  902. /**
  903. * Enables hash url navigation to for slides.
  904. * Object with hash navigation parameters or boolean `true` to enable with default settings
  905. *
  906. * @example
  907. * ```js
  908. * const swiper = new Swiper('.swiper', {
  909. * hashNavigation: {
  910. * replaceState: true,
  911. * },
  912. * });
  913. * ```
  914. */
  915. hashNavigation?: HashNavigationOptions | boolean;
  916. /**
  917. * Enables history push state where every slide will have its own url. In this parameter you have to specify main slides url like `"slides"` and specify every slide url using `data-history` attribute.
  918. *
  919. * Object with history navigation parameters or boolean `true` to enable with default settings
  920. *
  921. * @example
  922. * ```js
  923. * const swiper = new Swiper('.swiper', {
  924. * history: {
  925. * replaceState: true,
  926. * },
  927. * });
  928. * ```
  929. *
  930. * @example
  931. * ```html
  932. * <!-- will produce "slides/slide1" url in browser history -->
  933. * <div class="swiper-slide" data-history="slide1"></div>
  934. * ```
  935. */
  936. history?: HistoryOptions | boolean;
  937. /**
  938. * Enables navigation through slides using keyboard. Object with keyboard parameters or boolean `true` to enable with default settings
  939. *
  940. * @example
  941. * ```js
  942. * const swiper = new Swiper('.swiper', {
  943. * keyboard: {
  944. * enabled: true,
  945. * onlyInViewport: false,
  946. * },
  947. * });
  948. * ```
  949. */
  950. keyboard?: KeyboardOptions | boolean;
  951. /**
  952. * Enables images lazy loading. Object with lazy loading parameters or boolean `true` to enable with default settings
  953. *
  954. * @example
  955. * ```js
  956. * const swiper = new Swiper('.swiper', {
  957. * lazy: {
  958. * loadPrevNext: true,
  959. * },
  960. * });
  961. * ```
  962. */
  963. lazy?: LazyOptions | boolean;
  964. /**
  965. * Enables navigation through slides using mouse wheel. Object with mousewheel parameters or boolean `true` to enable with default settings
  966. *
  967. * @example
  968. * ```js
  969. * const swiper = new Swiper('.swiper', {
  970. * mousewheel: {
  971. * invert: true,
  972. * },
  973. * });
  974. * ```
  975. */
  976. mousewheel?: MousewheelOptions | boolean;
  977. /**
  978. * Object with navigation parameters or boolean `true` to enable with default settings.
  979. *
  980. * @example
  981. * ```js
  982. * const swiper = new Swiper('.swiper', {
  983. * navigation: {
  984. * nextEl: '.swiper-button-next',
  985. * prevEl: '.swiper-button-prev',
  986. * },
  987. * });
  988. * ```
  989. */
  990. navigation?: NavigationOptions | boolean;
  991. /**
  992. * Object with pagination parameters or boolean `true` to enable with default settings.
  993. *
  994. * @example
  995. * ```js
  996. * const swiper = new Swiper('.swiper', {
  997. * pagination: {
  998. * el: '.swiper-pagination',
  999. * type: 'bullets',
  1000. * },
  1001. * });
  1002. * ```
  1003. */
  1004. pagination?: PaginationOptions | boolean;
  1005. /**
  1006. * Object with parallax parameters or boolean `true` to enable with default settings.
  1007. *
  1008. * @example
  1009. * ```js
  1010. * const swiper = new Swiper('.swiper', {
  1011. * parallax: true,
  1012. * });
  1013. * ```
  1014. */
  1015. parallax?: ParallaxOptions | boolean;
  1016. /**
  1017. * Object with scrollbar parameters or boolean `true` to enable with default settings.
  1018. *
  1019. * @example
  1020. * ```js
  1021. * const swiper = new Swiper('.swiper', {
  1022. * scrollbar: {
  1023. * el: '.swiper-scrollbar',
  1024. * draggable: true,
  1025. * },
  1026. * });
  1027. * ```
  1028. */
  1029. scrollbar?: ScrollbarOptions | boolean;
  1030. /**
  1031. * Object with thumbs component parameters
  1032. *
  1033. * @example
  1034. * ```js
  1035. * const swiper = new Swiper('.swiper', {
  1036. * ...
  1037. * thumbs: {
  1038. * swiper: thumbsSwiper
  1039. * }
  1040. * });
  1041. * ```
  1042. */
  1043. thumbs?: ThumbsOptions;
  1044. /**
  1045. * Enables virtual slides functionality. Object with virtual slides parameters or boolean `true` to enable with default settings.
  1046. *
  1047. * @example
  1048. * ```js
  1049. * const swiper = new Swiper('.swiper', {
  1050. * virtual: {
  1051. * slides: ['Slide 1', 'Slide 2', 'Slide 3', 'Slide 4', 'Slide 5'],
  1052. * },
  1053. * });
  1054. * ```
  1055. */
  1056. virtual?: VirtualOptions | boolean;
  1057. /**
  1058. * Enables zooming functionality. Object with zoom parameters or boolean `true` to enable with default settings
  1059. *
  1060. * @example
  1061. * ```js
  1062. * const swiper = new Swiper('.swiper', {
  1063. * zoom: {
  1064. * maxRatio: 5,
  1065. * },
  1066. * });
  1067. * ```
  1068. */
  1069. zoom?: ZoomOptions | boolean;
  1070. /**
  1071. * Enables free mode functionality. Object with free mode parameters or boolean `true` to enable with default settings.
  1072. *
  1073. * @example
  1074. * ```js
  1075. * const swiper = new Swiper('.swiper', {
  1076. * freeMode: true,
  1077. * });
  1078. *
  1079. * const swiper = new Swiper('.swiper', {
  1080. * freeMode: {
  1081. * enabled: true,
  1082. * sticky: true,
  1083. * },
  1084. * });
  1085. * ```
  1086. */
  1087. freeMode?: FreeModeOptions | boolean;
  1088. /**
  1089. * Object with grid parameters to enable "multirow" slider.
  1090. *
  1091. * @example
  1092. * ```js
  1093. * const swiper = new Swiper('.swiper', {
  1094. * grid: {
  1095. * rows: 2,
  1096. * },
  1097. * });
  1098. * ```
  1099. */
  1100. grid?: GridOptions;
  1101. /**
  1102. * !INTERNAL When enabled will emit "_containerClasses" and "_slideClass" events
  1103. */
  1104. _emitClasses?: boolean;
  1105. }