Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Pandazaur/vue-segmented-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Segmented-Control

Segmented control for Vue.js

Vue Segmented Control visual

Demo

Demo on codesandbox.io

Installation

npm install vue-segmented-control

Usage

<template>
    <segmented-control
        :options="options"
        label="label"
        value="value"
        color="#fff"
        active-color="#333"
        :multiple="false"
        @select="onSelect"
    />
</template>
import SegmentedControl from 'vue-segmented-control'

export default {
    components: {
        SegmentedControl
    },
    data () {
        return {
            options: [
                { label: 'Red', value: 'red' },
                { label: 'Blue', value: 'blue' },
                { label: 'Green', value: 'green' }
            ]
        }
    },
    methods: {
        onSelect(optionsSelected) {
            // optionSelected: [{ label: '__', value: '__', ... }]
        }
    }
}

Documentation

Props:

Property Type Default Description Required
options Array(Object) Items selectables true
label String 'label' Property that define the label
value String 'value' Property that define the value (should be unique)
color String '#fff' Text color
activeColor String '#000' Background color of the selected items
multiple Boolean false Set to true to enable multiple selection

About

Segmented Control for Vue.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors