GithubHelp home page GithubHelp logo

samrahnama / triple-state-slider Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 98 KB

a slider that shows 3 state : previous, current, next.

License: Apache License 2.0

Vue 19.72% CSS 35.38% HTML 3.07% TypeScript 41.83%

triple-state-slider's Introduction

build status codecov

vue triple state slider

well this is slider that shows three states: previous, current and next slides written in typescript .

preview

for helping to update this library after forking the repo, try to run npm run dev. triple-state-slider-preview

install via npm

npm i @samrahnama/triple-state-slider

import slider component

import {createApp} from 'vue'
import {TripleStateSlider} from '@samrahnama/triple-state-slider'
import "@samrahnama/triple-state-slider/dist/main.css"


const app = createApp(App)
app.component('Slider',TripleStateSlider)

inside template:

<triple-state-slider :slides="sliderImages"/>

inside script:

<script setup lang="ts">
import type Slide from "@samrahnama/triple-state-slider/dist/types/Slide";

const sliderImages: Slide = [
        {
            order: 1,
            image: 'https://picsum.photos/1280/720?random=1',
            title: 'just a title',
        },
        {
            order: 2,
            image: 'https://picsum.photos/1280/720?random=2',
            title: 'just a title',
        },
        {
            order: 3,
            image: 'https://picsum.photos/1280/720?random=3',
            title: 'just a title',
        },
        {
            order: 4,
            image: 'https://picsum.photos/1280/720?random=4',
            title: 'just a title',
        },
        {
            order: 5,
            image: 'https://picsum.photos/1280/720?random=5',
            title: 'just a title',
        },
        {
            order: 6,
            image: 'https://picsum.photos/1280/720?random=6',
            title: 'just a title',
        },
    ]
    < /script>

props

name required type default description
slides yes array - the slides is an array of objects, the image property of object is the src of the each slide.
interval no number 5000 this is a timer for auto sliding, default : 5000ms
containerClass no string - you can use this prop to set container class of slider.
showButtons(* soon*) no boolean false hides/shows next and previous buttons.
infinite no boolean true when its true slider doesn't stop.

triple-state-slider's People

Contributors

samrahnama avatar

Stargazers

Michel Wächter avatar  avatar  avatar  avatar Mohammad Mortazavi avatar

Watchers

 avatar

triple-state-slider's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.