@ocrv/vue-tailwind-tabs

Vue Tailwind Tabs
1,197
Install
npm install @ocrv/vue-tailwind-tabs
Latest Version:1.0.3
Vue:3
License:MIT
Last Updated:Feb 17, 2021
Links: npm
Maintainer: stdi0

Vue Tailwind Tabs

build downloads-week downloads

Vue component for creating tabs using Tailwind CSS.

Снимок экрана 2021-02-17 в 11 31 05

Install

npm install --save @ocrv/vue-tailwind-tabs

Usage

  1. Import library styles
import '@ocrv/vue-tailwind-tabs/styles'
  1. Import the components
import {TabsWrapper, TabsContent, Tab} from '@ocrv/vue-tailwind-tabs'

Define data for activeTab and clickTab callback method

export default {
    components: {
        TabsWrapper,
        TabsContent,
        Tab
    },
    data() {
        return {
            activeTab: 'tab1'
        }
    },
    methods: {
        clickTab(name) {
            this.activeTab = name
        }
    }
}

Next, in your HTML code:

<TabsWrapper>
    <Tab title="Tab 1" :isActive="activeTab === 'tab1'" @click="clickTab('tab1')" />
    <Tab title="Tab 2" :isActive="activeTab === 'tab2'" @click="clickTab('tab2')" />
    <Tab title="Tab 3" :isActive="activeTab === 'tab3'" @click="clickTab('tab3')" />
</TabsWrapper>

<TabsContent>
    <div v-if="activeTab === 'tab1'">
        Ad alias animi at consequuntur cumque delectus, dolor doloribus illum in, odit porro quasi.
    </div>
    <div v-if="activeTab === 'tab2'">
        Aspernatur cupiditate, dolorum earum eius ex facilis!
    </div>
    <div v-if="activeTab === 'tab3'">
        Deserunt ducimus explicabo facere ipsam.
    </div>
</TabsContent>

More examples here

Related Packages

ink-ui

A Vue.js 2.0 UI Toolkit for Mobile

12,787 0
atom-design

Mobile side UI-library base on Vue.js

1,009 116
nova-vue

An enterprise-class UI design language and Vue components implementation

1,064 3
balm-ui

A modular and customizable UI library based on Material Design and Vue 3

38,974 507

Version History

Version Released Vue License
1.0.3 ^3.0.5 MIT
1.0.2 ^3.0.5 MIT
1.0.1 ^3.0.5 MIT
1.0.0 ^3.0.5 MIT
0.0.9 ^3.0.5 MIT