Swiper
Requires:
@ray-js/ray≥0.5.10
Description
Slider/Carousel container supporting automatic switching, seamless swiping, and indicator dots; requires an explicit overall height.
Props
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
dots | boolean | No | false | Whether to show indicator dots |
dotColor | string | No | rgba(0,0,0,0.3) | Indicator dot color |
dotActiveColor | string | No | #000 | Active indicator dot color |
autoplay | boolean | No | false | Whether to enable autoplay |
current | number | No | 0 | Index of the current slide |
interval | number | No | 5000 | Autoplay interval |
duration | number | No | 500 | Slide animation duration |
circular | boolean | No | false | Whether to enable circular sliding |
vertical | boolean | No | false | Whether the sliding direction is vertical |
dataSource | I[] | No | - | List data used with renderItem for rendering; the generic I infers the data type of each item. You can also omit dataSource and render directly with SwiperItem as children. |
| No | - | Render each list item; the item type is inferred from the generic I of dataSource. | ||
| No | - | Triggered when current changes | ||
| No | - | Triggered when the animation ends |
Valid Values
SwiperComponentChangeEvent.source
| Value | Description | Since |
|---|---|---|
'' | A slide change not triggered by autoplay or user swiping, such as changing the current slide via the current property | - |
autoplay | A slide change triggered by autoplay | - |
touch | A slide change triggered by user swiping | - |
SwiperChangeDetail.source
| Value | Description | Since |
|---|---|---|
'' | A slide change not triggered by autoplay or user swiping, such as changing the current slide via the current property | - |
autoplay | A slide change triggered by autoplay | - |
touch | A slide change triggered by user swiping | - |
SwiperComponentAfterChangeEvent.source
| Value | Description | Since |
|---|---|---|
'' | A slide change not triggered by autoplay or user swiping, such as changing the current slide via the current property | - |
autoplay | A slide change triggered by autoplay | - |
touch | A slide change triggered by user swiping | - |