# SwiperNode

<!-- schema:start — tự sinh từ swiper.schema.ts, không sửa tay -->

Carousel trượt ngang. Mỗi phần tử là một swiper-slide chứa nội dung tùy ý.

## Resolved name

`swiper`

## Configurable props

### Props

| Prop | Giá trị | Responsive | Mô tả |
| --- | --- | --- | --- |
| `slidesPerView` | `số nguyên ≥ 1 · 'auto'` | có | Số slide hiển thị cùng lúc, hoặc 'auto' |
| `spaceBetween` | `px` | có | Khoảng cách giữa các slide, đơn vị px |
| `autoplayOptions` | `object` | không | Cấu hình tự chạy |
| `autoplayOptions.active` | `true · false` | không | Bật tự chạy |
| `autoplayOptions.delay` | `số nguyên ≥ 0` | không | Thời gian giữa hai lần chuyển slide, đơn vị ms |
| `autoplayOptions.stopOnLastSnap` | `true · false` | không | true = dừng ở slide cuối, false = lặp lại |

### `sx`

| Key | Giá trị | Breakpoint |
| --- | --- | --- |
| `marginTop` | `px · 'auto'` | mọi breakpoint |
| `marginRight` | `px · 'auto'` | mọi breakpoint |
| `marginBottom` | `px · 'auto'` | mọi breakpoint |
| `marginLeft` | `px · 'auto'` | mọi breakpoint |
| `paddingTop` | `px` | mọi breakpoint |
| `paddingRight` | `px` | mọi breakpoint |
| `paddingBottom` | `px` | mọi breakpoint |
| `paddingLeft` | `px` | mọi breakpoint |
| `borderStyle` | `'solid' · 'dashed' · 'dotted'` | mọi breakpoint |
| `borderTopWidth` | `px` | mọi breakpoint |
| `borderRightWidth` | `px` | mọi breakpoint |
| `borderBottomWidth` | `px` | mọi breakpoint |
| `borderLeftWidth` | `px` | mọi breakpoint |
| `borderColor` | `color` | mọi breakpoint |
| `borderTopLeftRadius` | `px 0..9999` | mọi breakpoint |
| `borderTopRightRadius` | `px 0..9999` | mọi breakpoint |
| `borderBottomRightRadius` | `px 0..9999` | mọi breakpoint |
| `borderBottomLeftRadius` | `px 0..9999` | mọi breakpoint |
| `backgroundColor` | `color` | mọi breakpoint |
| `backgroundImage` | `url(https://…)` | mọi breakpoint |
| `backgroundSize` | `'cover' · 'contain' · 'auto'` | mọi breakpoint |
| `backgroundPosition` | `'left top' · 'top' · 'right top' · 'left' · 'center' · 'right' · 'left bottom' · 'bottom' · 'right bottom'` | mọi breakpoint |
| `backgroundRepeat` | `'no-repeat' · 'repeat-x' · 'repeat-y' · 'repeat'` | mọi breakpoint |
| `backgroundAttachment` | `'scroll' · 'fixed' · 'local'` | mọi breakpoint |

`color` = `var(--color-{primary\|secondary\|red\|orange\|yellow\|green\|blue\|violet\|neutral}-{100..800\|contrast}) · var(--color-background-{subtle\|default\|emphasis}) · var(--color-border-default) · var(--color-surface-default) · var(--color-common-{black\|white}) · #rgb · #rrggbb`

## Rules

- **Nội dung**: chỉ nhận `swiper-slide`.
- **Cha hợp lệ**: bất kỳ.

<!-- schema:end -->

## Usage

```tsx
import { SwiperNode, SwiperSlideNode, ParagraphNode } from '@janbox/storefront-builder';

// 3 slides hiển thị, autoplay với loop
<SwiperNode
  slidesPerView={3}
  spaceBetween={16}
  autoplayOptions={{
    active: true,
    delay: 3000,
    stopOnLastSnap: false, // loop
  }}
>
  <SwiperSlideNode><ParagraphNode>Slide 1</ParagraphNode></SwiperSlideNode>
  <SwiperSlideNode><ParagraphNode>Slide 2</ParagraphNode></SwiperSlideNode>
  <SwiperSlideNode><ParagraphNode>Slide 3</ParagraphNode></SwiperSlideNode>
</SwiperNode>

// Responsive: 1 slide mobile, 3 slides desktop
<SwiperNode
  slidesPerView={1}
  spaceBetween={8}
  md={{ slidesPerView: 3, spaceBetween: 24 }}
  sx={{
    paddingTop: 16,
    paddingBottom: 16,
  }}
>
  <SwiperSlideNode>...</SwiperSlideNode>
  <SwiperSlideNode>...</SwiperSlideNode>
  <SwiperSlideNode>...</SwiperSlideNode>
</SwiperNode>
```

## Related nodes

- [`SwiperSlideNode`](../swiper-slide/README.md) — mỗi slide item
