Skip to content

Commit 96001d1

Browse files
committed
docs: update README and configuration documentation for clarity and consistency; add Carousel component documentation
1 parent 932a888 commit 96001d1

File tree

8 files changed

+282
-136
lines changed

8 files changed

+282
-136
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const carouselConfig = {
7272
Visit our [documentation website](https://vue3-carousel.ismail9k.com/) for detailed usage and examples:
7373

7474
- [Getting Started](https://vue3-carousel.ismail9k.com/getting-started)
75-
- [Carousel Config](https://vue3-carousel.ismail9k.com/config)
75+
- [Carousel Configuration](https://vue3-carousel.ismail9k.com/config)
76+
- [Carousel Component](https://vue3-carousel.ismail9k.com/components/carousel)
7677
- [Slide Component](https://vue3-carousel.ismail9k.com/components/slide)
7778
- [Navigation Component](https://vue3-carousel.ismail9k.com/components/navigation)
7879
- [Pagination Component](https://vue3-carousel.ismail9k.com/components/pagination)

docs/.vitepress/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ module.exports = {
2424
text: 'Introduction',
2525
items: [
2626
{ text: 'Getting Started', link: '/getting-started' },
27-
{ text: 'Config', link: '/config' },
27+
{ text: 'Configuration', link: '/config' },
2828
{ text: 'Examples', link: '/examples' },
2929
],
3030
},
3131
{
3232
text: 'Components',
3333
items: [
34+
{ text: 'Carousel', link: '/components/carousel' },
3435
{ text: 'Slide', link: '/components/slide' },
3536
{ text: 'Navigation', link: '/components/navigation' },
3637
{ text: 'Pagination', link: '/components/pagination' },

docs/components/carousel.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Carousel Component
2+
3+
The Carousel component is the main container that manages slides, navigation, and overall carousel functionality.
4+
5+
## Basic Usage
6+
7+
```vue
8+
<template>
9+
<Carousel>
10+
<Slide v-for="slide in 10" :key="slide">
11+
<div class="carousel__item">{{ slide }}</div>
12+
</Slide>
13+
14+
<template #addons>
15+
<Navigation />
16+
<Pagination />
17+
</template>
18+
</Carousel>
19+
</template>
20+
```
21+
22+
## Slots
23+
24+
### Default/Slides Slot
25+
26+
Used to render the carousel items. You can use either the default slot or wrap elements in the `slides` slot.
27+
28+
```vue
29+
<template>
30+
<Carousel>
31+
<template #slides>
32+
<Slide v-for="slide in 10" :key="slide">
33+
...
34+
</Slide>
35+
</template>
36+
</Carousel>
37+
</template>
38+
```
39+
40+
### Addons Slot
41+
42+
Used to add display carousel addon components such as Navigation and Pagination.
43+
44+
```vue
45+
<template>
46+
<Carousel>
47+
...
48+
<template #addons>
49+
<Navigation />
50+
<Pagination />
51+
</template>
52+
</Carousel>
53+
</template>
54+
```
55+
56+
## Slot Props
57+
58+
The following props are passed to slots and can be used within them:
59+
60+
| Name | Type | Description |
61+
| -------------- | ------- | ------------------------------------------- |
62+
| `config` | Object | Configuration object with carousel settings. |
63+
| `currentSlide` | Number | Index number of the current slide. |
64+
| `maxSlide` | Number | The maximum slide index. |
65+
| `middleSlide` | Number | The middle slide index. |
66+
| `minSlide` | Number | The minimum slide index. |
67+
| `slideSize` | Number | The width/height of a single slide element. |
68+
| `slidesCount` | Number | The count of all slides. |
69+
70+
## Styling
71+
72+
The Carousel component provides several CSS classes that you can use for styling:
73+
74+
| CSS Class | Description |
75+
| -------------------- | --------------------------------- |
76+
| `.carousel` | Main carousel container |
77+
| `.carousel__viewport`| Carousel viewport/wrapper element |
78+
| `.carousel__track` | Container for slides |
79+
80+
For more information about configuration options, see the [Configuration documentation](/config).

0 commit comments

Comments
 (0)