For Tailwind CSS v3 docs, click here.

Images Slider

A full page slider with images that can be navigated with the keyboard.

通过 CLI 安装

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/images-slider.json"

手动安装

复制并粘贴以下代码:

ImagesSlider.vue

API

Prop 名称类型默认值描述
imagesstring[][]An array of image URLs to show in the slider.
hideOverlaybooleanfalseDon't create an overlay for the image slider. Slot won't be rendered.
overlayClassstring''A class string to be applied to the overlay container.
imageClassstring'bg-cover bg-center bg-no-repeat'Class string to apply to each of the images.
enterFromClassstring'scale-0 origin-center'Class string applied to the 'enter-from-class' prop on the image transition.
enterActiveClassstring'transition-transform duration-300 ease-in-out'Class string applied to the 'enter-active-class' prop on the image transition.
leaveActiveClassstring'transition-transform duration-300 ease-in-out'Class string applied to the 'leave-active-class' prop on the image transition.
autoplayboolean|numberfalseAutoplay interval in ms, or false to disable.
direction'vertical'|'horizontal''vertical'The axis on which the slider should operate.
perspectivestring'1000px'The perspective to apply to the slider container.
modelValuenumber0Two-way binding for the current slide image index.

功能特性

  • Horizontal & Vertical Animations: You can animate the images horizontally (default) or vertically with the direction prop.
  • Preloaded Images: Images are preloaded before showing, preventing flickering loading animation.
  • Customisable Autoplay: Automatically transition through your slides, or allow your users to navigate manually.
  • Overlay Anything: The default slot allows you to overlay whatever content you wish overlay slider.

感谢