GitHub

Image Slider

Image carousel with navigation controls

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { ImageSlider } from "@corew500/ui/image-slider"

<ImageSlider>Content</ImageSlider>

Variants

imageSliderVariants

AxisValuesDefault
variant
defaultminimalframed
default
aspectRatio
16/94/31/1auto
16/9

API Reference

Props

PropTypeDefaultDescription
images*SliderImage[]Array of images to display
modeenumcarouselSlider mode: carousel or comparison
autoPlayenumfalseEnable auto-play in carousel mode
intervalnumber5000Auto-play interval in milliseconds
showControlsenumtrueShow navigation controls
showIndicatorsenumtrueShow indicator dots
onSlideChange(index: number) => voidCallback when slide changes
defaultIndexnumber0Initial slide index
variantenumdefault
aspectRatioenum16/9

Accessibility

Keyboard Navigation

  • Keyboard: Arrow keys navigate slides or adjust slider position.

Screen Readers

  • - Carousel: `role="region"` with `aria-roledescription="carousel"`.
  • Comparison: `role="slider"` with proper ARIA value attributes.
  • All images require alt text for screen readers.

Localization

Translatable Content

  • - Alt text for images should be translated.
  • ARIA labels ("Previous slide", "Next slide") are hardcoded but can be customized.

Related

Related Components