Toolbar / Tabbar - 图1

Toolbar Vue Component

Toolbar is a fixed (with Fixed and Through layout types) area at the bottom of a screen that contains navigation elements. Toolbar does not have any parts, just plain links inside

Toolbar Vue component represents Toolbar component.

Toolbar Components

There are following components included:

  • **f7-toolbar**

Toolbar Properties

PropTypeDefaultDescription
<f7-toolbar> properties
innerbooleantrueWhen enabled (by default), it will put all the content within internal toolbar-inner element. Disable it only in case you want to put totally custom layout inside
bottom-mdbooleanfalseDefines whether the Toolbar should be on bottom or not (MD theme only)
tabbarbooleanfalseDefines whether the Toolbar is also a Tabbar or not
labelsbooleanfalseEnables Tabbar with labels (affects only when tabbar: true)
scrollablebooleanfalseEnables scrollable Tabbar (affects only when tabbar: true)
no-shadowbooleanDisable shadow rendering for Material theme
no-hairlinebooleanfalseDisable toolbar/tabbar top thin border (hairline) for iOS theme
hiddenbooleanfalseMakes toolbar hidden

Toolbar Methods

<f7-toolbar> methods
.hide(animate)Hide toolbar
.show(animate)Show toolbar

Toolbar Slots

Toolbar Vue component (<f7-toolbar>) has additional slots for custom elements:

  • **default** - element will be inserted as a child of <div class="toolbar-inner"> element
  • **before-inner** - element will be inserted right before <div class="toolbar-inner"> element
  • **after-inner** - element will be inserted right after <div class="toolbar-inner"> element
  1. <f7-toolbar>
  2. <div slot="before-inner">Before Inner</div>
  3. <div slot="after-inner">After Inner</div>
  4. <!-- Goes to default slot: -->
  5. <f7-link>Left Link</f7-link>
  6. <f7-link>Right Link</f7-link>
  7. </f7-toolbar>
  8. <!-- Renders to: -->
  9. <div class="toolbar">
  10. <div>Before Inner</div>
  11. <div class="toolbar-inner">
  12. <a href="#" class="link">Left Link</a>
  13. <a href="#" class="link">Right Link</a>
  14. </div>
  15. <div>After Inner</div>
  16. </div>

Examples

Toolbar

  1. <template>
  2. <f7-page>
  3. <f7-navbar title="Toolbar" back-link="Back"></f7-navbar>
  4. <f7-toolbar :bottom-md="isBottom">
  5. <f7-link>Left Link</f7-link>
  6. <f7-link>Right Link</f7-link>
  7. </f7-toolbar>
  8. <f7-block-title v-if="$theme.md">Toolbar Position</f7-block-title>
  9. <f7-block v-if="$theme.md">
  10. <p>Material (MD) theme toolbar supports both top and bottom positions. Click the following button to change its position.</p>
  11. <p>
  12. <f7-button raised @click="isBottom = !isBottom">Toggle Toolbar Position</f7-button>
  13. </p>
  14. </f7-block>
  15. <f7-block>
  16. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ullam enim quia molestiae facilis laudantium voluptates obcaecati officia cum, sit libero commodi...</p>
  17. </f7-block>
  18. </f7-page>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. isBottom: false,
  25. };
  26. }
  27. }
  28. </script>

Tabbar

  1. <template>
  2. <f7-page :page-content="false">
  3. <f7-navbar title="Tabbar" back-link="Back">
  4. <f7-nav-right v-if="$theme.md">
  5. <f7-link icon-material="compare_arrows" @click="isBottom != isBottom"></f7-link>
  6. </f7-nav-right>
  7. </f7-navbar>
  8. <f7-toolbar tabbar :bottom-md="isBottom">
  9. <f7-link tab-link="#tab-1" tab-link-active>Tab 1</f7-link>
  10. <f7-link tab-link="#tab-2">Tab 2</f7-link>
  11. <f7-link tab-link="#tab-3">Tab 3</f7-link>
  12. </f7-toolbar>
  13. <f7-tabs>
  14. <f7-tab id="tab-1" class="page-content" tab-active>
  15. <f7-block>
  16. <p>Tab 1 content</p>
  17. ...
  18. </f7-block>
  19. </f7-tab>
  20. <f7-tab id="tab-2" class="page-content">
  21. <f7-block>
  22. <p>Tab 2 content</p>
  23. ...
  24. </f7-block>
  25. </f7-tab>
  26. <f7-tab id="tab-3" class="page-content">
  27. <f7-block>
  28. <p>Tab 3 content</p>
  29. ...
  30. </f7-block>
  31. </f7-tab>
  32. </f7-tabs>
  33. </f7-page>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. isBottom: false,
  40. };
  41. }
  42. }
  43. </script>

Tabbar Labels

  1. <template>
  2. <f7-page :page-content="false">
  3. <f7-navbar title="Tabbar Labels" back-link="Back">
  4. <f7-nav-right v-if="$theme.md">
  5. <f7-link icon-material="compare_arrows" @click="isBottom != isBottom"></f7-link>
  6. </f7-nav-right>
  7. </f7-navbar>
  8. <f7-toolbar tabbar labels :bottom-md="isBottom">
  9. <f7-link tab-link="#tab-1" tab-link-active text="Tab 1" icon-ios="f7:email_fill" icon-md="material:email"></f7-link>
  10. <f7-link tab-link="#tab-2" text="Tab 2" icon-ios="f7:today_fill" icon-md="material:today"></f7-link>
  11. <f7-link tab-link="#tab-3" text="Tab 3" icon-ios="f7:cloud_fill" icon-md="material:file_upload"></f7-link>
  12. </f7-toolbar>
  13. <f7-tabs>
  14. <f7-tab id="tab-1" class="page-content" tab-active>
  15. <f7-block>
  16. <p>Tab 1 content</p>
  17. ...
  18. </f7-block>
  19. </f7-tab>
  20. <f7-tab id="tab-2" class="page-content">
  21. <f7-block>
  22. <p>Tab 2 content</p>
  23. ...
  24. </f7-block>
  25. </f7-tab>
  26. <f7-tab id="tab-3" class="page-content">
  27. <f7-block>
  28. <p>Tab 3 content</p>
  29. ...
  30. </f7-block>
  31. </f7-tab>
  32. </f7-tabs>
  33. </f7-page>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. isBottom: false,
  40. };
  41. }
  42. }
  43. </script>

Tabbar Scrollable

  1. <template>
  2. <f7-page :page-content="false">
  3. <f7-navbar title="Tabbar Scrollable" back-link="Back">
  4. <f7-nav-right v-if="$theme.md">
  5. <f7-link icon-material="compare_arrows" @click="isBottom != isBottom"></f7-link>
  6. </f7-nav-right>
  7. </f7-navbar>
  8. <f7-toolbar tabbar scrollable :bottom-md="isBottom">
  9. <f7-link
  10. v-for="(tab, index) in tabs"
  11. :key="tab"
  12. :tab-link="`#tab-${tab}`"
  13. :tab-link-active="index === 0"
  14. >Tab {{tab}}</f7-link>
  15. </f7-toolbar>
  16. <f7-tabs>
  17. <f7-tab
  18. v-for="(tab, index) in tabs"
  19. :key="tab"
  20. :id="`tab-${tab}`"
  21. class="page-content"
  22. :tab-active="index === 0"
  23. >
  24. <f7-block>
  25. <p><b>Tab {{tab}} content</b></p>
  26. ...
  27. </f7-block>
  28. </f7-tab>
  29. </f7-tabs>
  30. </f7-page>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. tabs: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  37. isBottom: false,
  38. };
  39. }
  40. }
  41. </script>

Hide Toolbar On Scroll

  1. <template>
  2. <f7-page hide-toolbar-on-scroll>
  3. <f7-navbar title="Hide Toolbar On Scroll" back-link="Back"></f7-navbar>
  4. <f7-toolbar bottom-md>
  5. <f7-link>Left Link</f7-link>
  6. <f7-link>Right Link</f7-link>
  7. </f7-toolbar>
  8. <f7-block strong>
  9. <p>Toolbar will be hidden if you scroll bottom</p>
  10. </f7-block>
  11. <f7-block>
  12. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos maxime incidunt id ab culpa ipsa omnis eos, vel excepturi officiis neque illum perferendis dolorum magnam rerum natus dolore nulla ex.</p>
  13. ...
  14. </f7-block>
  15. </f7-page>
  16. </template>