A click-based carousel (run it care-free).
npm install carefree-carousel
-
import Carousel from 'carefree-carousel';
-
var Carousel = require('carefree-carousel');
- If the above are not working or fitting your specific use-case try one of the other bundle versions by explicit import/require
(Example) import Carousel from 'carefree-carousel/dist/bundle.min.js'
demo.mov
<Carousel toggleDots={false} slideText={false} toggleNav={false} startIndex={0} delayTime={4000} />
content={[<div>An element</div>, "a-image-link-here", "other-image-link", <p>a new element</p>]}
navImg={["image-for-left-arrow-here", "image-for-right-arrow-here"]}
- Preloading images
- Transitioning effect between images
- Error checking for correct types (Will display an error message)
Parameter | Type | Default value(s) | Trigger action |
---|---|---|---|
autoPlay | bool | false | Toggle On/Off auto-play between slides |
content | array | Provided 3 images | Add custom images or elements for each slide |
delayTime | int | 3 seconds | Change the time between each slide |
navImg | arrayOfStrings | Provided 2 images | Add custom images for pagination arrows |
slideText | bool | true | Toggle displaying On/Off of current slide # |
startIndex | int | 0 | Choose which slide to begin playback on |
toggleDots | bool | false | Toggle displaying dots navigation On/Off |
toggleNav | bool | true | Toggle displaying arrows navigation On/Off |
Thank you to Unsplash for image hosting and individual contributors for uploading their images:
Thank you to shields.io for the templates they have provided.
Thank you to all dependency library authors, make sure to check them out if you get the chance.