--- title: Swiper icon: dashicons:images-alt2 createTime: 2025/10/08 22:00:22 permalink: /en/guide/components/swiper/ --- ## Overview Use the `` component to display image carousels on pages. ## Usage To use this component, first manually install the `swiper` library: ::: npm-to ```sh npm install swiper ``` ::: Then, manually import the `Swiper` component: ```md ``` Register as a global component: ```ts title=".vuepress/client.ts" import Swiper from 'vuepress-theme-plume/features/Swiper.vue' import { defineClientConfig } from 'vuepress/client' export default defineClientConfig({ enhance({ app }) { app.component('Swiper', Swiper) }, }) ``` Global components can be used in any other markdown file: ```md ``` **Example:** ## Props | Name | Type | Default | Description | | ----------------- | ---------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------- | | items | `string \| { link: string; href?: string; alt?: string}[]` | `[]` | Image link array. When passing objects, `link` represents image URL, `href` represents navigation link, `alt` represents image description | | width | `number \| string` | `100%` | Carousel area width | | height | `number \| string` | `100%` | Carousel area height | | mode | `'banner' \| 'carousel' \| 'broadcast'` | `'banner'` | Carousel mode: `banner`: banner; `carousel`: carousel; `broadcast`: information display | | navigation | `boolean` | `true` | Whether to show navigation buttons | | effect | `'slide' \| 'fade' \| 'cube' \| 'coverflow' \| 'flip' \| 'cards' \| 'creative'` | `'slide'` | Carousel effect | | delay | `number` | `3000` | Carousel interval time. Only effective when `mode: 'banner'`. Unit: `ms` | | speed | `number` | `300` | Animation duration. Unit: `ms` | | loop | `boolean` | `true` | Whether to loop | | pauseOnMouseEnter | `boolean` | `false` | Whether to pause carousel on mouse hover | | swipe | `boolean` | `true` | Whether to enable gesture swiping | For more props, refer to [Swiper Documentation](https://swiperjs.com/swiper-api#parameters) ## Reference Examples ### Preset Animation Effects **cube:** :::details View Code ```md ``` ::: **fade:** :::details View Code ```md ``` ::: **coverflow:** :::details View Code ```md ``` ::: **flip:** :::details View Code ```md ``` ::: **cards:** :::details View Code ```md ``` ::: ### Custom Animation Effects **Example 1:** ::: details View Code ```md ``` ::: **Example 2:** :::details View Code ```md ``` ::: **Example 3:** :::details View Code ```md ``` ::: **Example 4:** :::details View Code ```md ``` ::: ### Carousel :::details View Code ```md ``` ::: ### Information Display :::details View Code ```md ``` :::