1.1.2 • Published 2 years ago

vue-material-tabs v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Demo

⚓ Features

  • Touch swippe.
  • Vertical and animation support.
  • Flexible and customizable.
  • Zero dependencies.

🚚 Install

 yarn add vue-material-tabs  // npm install --save vue-material-tabs

🚀 Usage

Global

import Vue from "vue";
import VueMaterialTabs from "vue-material-tabs";

Vue.use(VueMaterialTabs);

Local

import { Tabs, TabItem } from "vue-material-tabs";

export default {
  components: {
    Tabs,
    TabItem,
  },
};

📌 Examples

<Tabs>
  <TabItem name="Foo">
    <div class="first-tab">First tab</div>
  </TabItem>
  <TabItem name="Bar">
    <div class="second-tab">Second tab</div>
  </TabItem>
</Tabs>

Do use #name slot to customize the nav title (When the slot #name is used, the prop name is replaced)

<Tabs>
  <TabItem>
    <template #name>
        My custom title 🍉
    </template>

    <div class="first-tab">
      First tab
    </div>
  </TabItem>
</Tabs>

👑 Themes

There are some themes available to customize your tab nav.
  • default
  • purple
  • red
  • pink
  • cyan
  • green

Example

<Tabs theme="cyan">....</Tabs>

You can create your own custom themes, with theme prop.

Example

<Tabs :theme="theme" >
  ....
</Tabs>
....
<script>
  export default {
    data: () => ({
      theme: {
        nav: "#4A148C",
        navItem: "#BDBDBD",
        navActiveItem: "#fff",
        slider: "#CE93D8",
        arrow: "#f3f3f3",
      },
    }),
  };
</script>

Tabs

Props

NametypeDefaultdescription
valueStringundefinedThe designated model value for the component.
themeString - Object'default'Apply an available or customized theme.
verticalBooleanfalseUses a vertical transition when changing windows.
rippleBooleantrueRipple tab nav effect.
slideDurationString - Number200Set slide duration in ms.
slideVerticalBooleanfalseVertical slide animation.
slideBoolean - ObjectfalseEnable/disable slide or set object with props.
navAutoBooleanfalseOrganize tab nav items auto
navSliderBooleantrueNav bar slider.
noTouchBooleanfalseSwippe tab by touch.

Slots

NameDescriptionProps
navSlot to replace the nav menu.{ navItems: Array, active: String }

Events

NameDescription
inputEmitted when tab is changed.

TabItem

Props

NametypeDefaultdescription
nameString'Tab Item'Tab item title
disabledBooleanfalseRemoves the ability to click or target the component.

Slots

NameDescription
nameCustom tab nav name

🔖 License

MIT

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago