* refactor: eslint config adjusted for better diff's * refactor: stricter linting + dependencies updated * refactoring: paragraph component - component - docs * refactoring: heading component - component - docs * Update docs/components/heading.md Co-authored-by: Ilya Artamonov <ilya.sosidka@gmail.com> * refactoring: link component - component - docs * refactoring: image component - component - docs * refactoring: alert component - component - docs * refactoring: avatar component - component - docs * refactoring: removed unnecessary code - component names come from the file name * refactoring: breadcrumb component - component - docs * refactoring: accordion component - component - docs * refactoring: buttom component - component - docs * refactoring: badge component - component - docs * refactoring: card component - component - docs * refactoring: order of components in docs updated * refactoring: unnecessary semicolons removed * refactoring: button group component - component - docs * refactoring: carousel component - component - docs * refactoring: dropdown component - component - docs * refactoring: footer component - component - docs * refactoring:list-group component - component - docs * refactoring: modal component - component - docs * refactoring: navbar component - component - docs * refactoring: pagination component - component - docs * refactoring: progress component - component - docs * refactoring: rating component - component - docs * refactoring: spinner component - component - docs * refactoring: table component - component - docs * refactoring: tabs component - component - docs * feat: Updated pagination examples * lint: Lister fixes * feat: Sidebar component and some fixes * feat: Input component * feat: Some fixes * feat: Some fixes * chore: update deps * refactor: removed old Modal component * refactor: radio component and some fixes * fix: fixed path error * refactor: Range component * refactoring: timeline component - component - docs * refactor: Select component * refactoring: toast component - component - docs * refactoring: tooltip component - component - docs * refactoring: sidebar component - component - docs * refactoring: input component - component - docs * refactoring: fileInput component - component - docs * refactoring: select component - component - docs * refactoring: textarea component - component - docs * refactoring: checkbox component - component - docs * refactoring: radio component - component - docs * refactoring: toggle component - component - docs * refactoring: range component - component - docs * local configs linted * documentation quick start updated * flowbite-themable refactored to fit new linters and style guide * random linter fixes * refactoring: toast-provider component - component - docs * final linter fixes * lint: Linter fixes * fix: Fixed types * fix: Fixed card component * docs: Updated card examples * fix: Fixed tabs * refactor: Heading component refactoring * Fwb rename - few fixes after component review (#237) * fix: button documentation * fix: model type in range examples * chore: Toast marked as WIP --------- Co-authored-by: Sqrcz <naorniakowski@slashlab.pl> Co-authored-by: Sqrcz <naorniakowski@gmail.com>
181 lines
4.6 KiB
Markdown
181 lines
4.6 KiB
Markdown
<script setup>
|
|
import FwbTabsExample from './tabs/examples/FwbTabsExample.vue'
|
|
import FwbTabsExampleInteraction from './tabs/examples/FwbTabsExampleInteraction.vue'
|
|
import FwbTabsExampleDirective from './tabs/examples/FwbTabsExampleDirective.vue'
|
|
import FwbTabsExamplePills from './tabs/examples/FwbTabsExamplePills.vue'
|
|
import FwbTabsExampleUnderline from './tabs/examples/FwbTabsExampleUnderline.vue'
|
|
</script>
|
|
|
|
# Vue Tabs - Flowbite
|
|
|
|
#### Use these responsive tabs components to create a secondary navigational hierarchy for your website or toggle content inside a container
|
|
|
|
---
|
|
|
|
:::tip
|
|
Original reference: [https://flowbite.com/docs/components/tabs/](https://flowbite.com/docs/components/tabs/)
|
|
:::
|
|
|
|
The tabs component can be used either as an extra navigational hierarchy complementing the main navbar or you can also use it to change content inside a container just below the tabs using the data attributes from Flowbite.
|
|
|
|
## Prop - variant (default)
|
|
|
|
<fwb-tabs-example />
|
|
```vue
|
|
<template>
|
|
<fwb-tabs v-model="activeTab" class="p-5">
|
|
<fwb-tab name="first" title="First">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="second" title="Second">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="third" title="Third">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="fourth" title="Fourth" disabled>
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
</fwb-tabs>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { FwbTab, FwbTabs } from 'flowbite-vue'
|
|
|
|
const activeTab = ref('first')
|
|
</script>
|
|
```
|
|
|
|
## Prop - variant (underline)
|
|
|
|
<fwb-tabsExample-underline />
|
|
```vue
|
|
<template>
|
|
<fwb-tabs v-model="activeTab" variant="underline" class="p-5">
|
|
<fwb-tab name="first" title="First">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="second" title="Second">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="third" title="Third">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="fourth" title="Fourth" disabled>
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
</fwb-tabs>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { FwbTab, FwbTabs } from 'flowbite-vue'
|
|
|
|
const activeTab = ref('first')
|
|
</script>
|
|
```
|
|
|
|
## Prop - variant (pills)
|
|
|
|
<fwb-tabs-example-pills />
|
|
```vue
|
|
<template>
|
|
<fwb-tabs v-model="activeTab" variant="pills" class="p-5">
|
|
<fwb-tab name="first" title="First" >
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="second" title="Second">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="third" title="Third">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="fourth" title="Fourth" disabled>
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
</fwb-tabs>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { FwbTab, FwbTabs } from 'flowbite-vue'
|
|
|
|
const activeTab = ref('first')
|
|
</script>
|
|
```
|
|
|
|
## Prop - directive
|
|
|
|
Use this props if you want to control which directive to use for rendering every tab content
|
|
|
|
<fwb-tabs-example-directive />
|
|
```vue
|
|
<template>
|
|
<fwb-tabs v-model="activeTab" directive="show" class="p-5">
|
|
<fwb-tab name="first" title="First">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="second" title="Second">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="third" title="Third">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="fourth" title="Fourth" disabled>
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
</fwb-tabs>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { FwbTab, FwbTabs } from 'flowbite-vue'
|
|
|
|
const activeTab = ref('first')
|
|
</script>
|
|
```
|
|
|
|
## Tab pane interaction
|
|
|
|
You can add `@click:pane` to Tabs component to intercept click on tab pane.
|
|
|
|
<fwb-tabs-example-interaction />
|
|
```vue
|
|
<template>
|
|
<fwb-tabs @click:pane="handlePaneClick" v-model="activeTab" class="p-5">
|
|
<fwb-tab name="first" title="First">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="second" title="Second">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="third" title="Third">
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
<fwb-tab name="fourth" title="Fourth" disabled>
|
|
Lorem ipsum dolor...
|
|
</fwb-tab>
|
|
</fwb-tabs>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { FwbTab, FwbTabs } from 'flowbite-vue'
|
|
|
|
const activeTab = ref('first')
|
|
|
|
const handlePaneClick = () => { console.log('Click!') }
|
|
</script>
|
|
```
|
|
|
|
## API
|
|
|
|
### Props
|
|
| Name | Values | Default |
|
|
|------------|--------------------------------|-----------|
|
|
| directive | `if`, `show` | `if` |
|
|
| modelValue | `string` | `''` |
|
|
| variant | `default`, `underline`, `pill` | `default` |
|