Carousel
# FxCarousel Carousel
Displays content like images or text in a limited space with cyclic playback.
# Carousel Attributes
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
| height | Height of the carousel | string | — | — |
| initial-index | Index of initially active slide (starting from 0) | number | — | 0 |
| trigger | How indicators are triggered | string | click | — |
| autoplay | Whether to automatically switch slides | boolean | — | true |
| interval | Interval for auto-switching (milliseconds) | number | — | 3000 |
| indicator-position | Position of indicators | string | outside/none | — |
| arrow | When to show arrow buttons | string | always/hover/never | hover |
| type | Type of the carousel | string | card | — |
| loop | Whether to display items in loop | boolean | - | true |
| direction | Display direction | string | horizontal/vertical | horizontal |
# Carousel Events
| Event Name | Description | Parameters |
|---|---|---|
| change | Triggers when slide changes | Index of current active slide, index of previous slide |
# Carousel Methods
| Method | Description | Parameters |
|---|---|---|
| setActiveItem | Manually switch slides | Index of target slide (starting from 0), or the name of target el-carousel-item |
| prev | Switch to previous slide | — |
| next | Switch to next slide | — |
# Carousel-Item Attributes
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
| name | Name of the slide, used for setActiveItem | string | — | — |
| label | Text content for corresponding indicator | string | — | — |
# Basic Usage
Basic usage suitable for most scenarios.
Default hover trigger
1
2
3
4
Click trigger
1
2
3
4
Copy
# Indicators
Position indicators outside the container.
1
2
3
4
Copy
# Arrow Buttons
Control when navigation arrows appear.
1
2
3
4
Copy
# Card Style
Use card mode when horizontal space is ample but vertical space is limited.
1
2
3
4
5
6
Copy
# Direction
By default, direction is horizontal. Set to vertical for vertical display.
1
2
3
Copy