nb-slide-div-fixed-size
This is a slide component for Vue.js 3+.
Look at the console to see the triggered event
Installation
yarn add @vlalg-nimbus/nb-slides
Usage
import { createApp } from 'vue'
import App from './App.vue'
import NbSlidesComponents from '@vlalg-nimbus/nb-slides'
import "@vlalg-nimbus/nb-slides/dist/style.css";
const app = createApp(App)
app.use(NbSlidesComponents)
app.mount('#app')
To use, simply call the component, in this case it will be NbSlideDivFixedSize
or nb-slide-div-fixed-size
.
<template>
<NbSlideDivFixedSize />
</template>
Preview & Playground
Select the component you want to edit/test
Props
Items with an (*) mean they are required
name | Value type | Default | Description |
---|---|---|---|
nbId (*) | String | Sets the id attribute to differentiate from other components | |
display | String | 'b' | Defines the display type. Accepts ib and b. |
disabled | Boolean | false | Defines if the slide is disabled |
borderRadius | Number | 0.375 | Defines border-radius. |
slideType | String | 'transform' | Defines the slide type. Accepts transform and z-index. |
slideWidth | Number | 200 | Defines slide width. |
slideHeight | Number | 200 | Defines slide height. |
slideInterval | Number | 5000 | Defines the slider speed. |
showButtons | Boolean | true | Defines whether the buttons are shown. |
buttonsSize | Number | 10 | Defines slide buttons size. |
buttonMarginTop | Number | 10 | Defines slide buttons margin top. |
buttonMarginBottom | Number | 10 | Defines slide buttons margin bottom. |
buttonsColor | String | 'tomato' | Defines the buttons color. Accepts Color name and Hex |
buttonsColorHover | String | 'blue' | Defines the buttons color on hover and active. Accepts Color name and Hex |
showProgressBar | Boolean | false | Defines whether the progress bar is shown. |
progressColor | String | 'blue' | Defines the progress bar color. Accepts Color name and Hex |
Slots
The component has slots called slide+NUMBER
where the content that will be manipulated must be passed, the slideNUMBER
is made up of the word slide
plus the slide number, it needs to be in ascending order and starting with the number 1. It has a default text (Default Text
) in case the content does not pass through the slot.
<template>
<NbSlideDivFixedSize>
<template #slide1>
<div>
CONTENT/TEXT 1
</div>
</template>
<template #slide2>
<div>
CONTENT/TEXT 2
</div>
</template>
...
<template #slide5>
<div>
CONTENT/TEXT 5
</div>
</template>
</NbSlideDivFixedSize>
</template>
The example below shows the use of the slot for 5 contents.
I recommend using text-wrap
and/or word-break
in the div (wrapper) of your content to be able to break the texts, test first without these stylizations and then with them to see the difference.