Appbar - 图1

Appbar

Appbar is the main app bar with actions on top of the whole app. It is designed to be used in desktop apps with Aurora theme.

Appbar Layout

Appbar layour is pretty simple:

  1. <div class="appbar">
  2. <div class="appbar-inner">
  3. <!-- ... Appbar content -->
  4. </div>
  5. </div>

To be on top of the whole app it must be placed in App’s root element before Panels and Views:

  1. <div id="app">
  2. <!-- Appbar -->
  3. <div class="appbar">
  4. <div class="appbar-inner">
  5. <!-- ... Appbar content -->
  6. </div>
  7. </div>
  8. <!-- Panels -->
  9. <div class="panel panel-left panel-reveal">...</div>
  10. <!-- Views -->
  11. <div class="view view-main">...</div>
  12. ...
  13. </div>
  1. <span class="badge">32</span>

CSS Variables

Below is the list of related CSS variables (CSS custom properties).

Note that commented variables are not specified by default and their values is what they fallback to in this case.

  1. :root {
  2. /*
  3. --f7-appbar-offset: var(--f7-appbar-height);
  4. --f7-appbar-extra-offset: 0px;
  5. --f7-appbar-bg-color: var(--f7-bars-bg-color);
  6. --f7-appbar-bg-image: var(--f7-bars-bg-image);
  7. --f7-appbar-border-color: var(--f7-bars-border-color);
  8. --f7-appbar-link-color: var(--f7-bars-link-color);
  9. --f7-appbar-text-color: var(--f7-bars-text-color);
  10. */
  11. --f7-appbar-shadow-image: none;
  12. }
  13. .ios {
  14. --f7-appbar-height: 44px;
  15. --f7-appbar-inner-padding-left: 8px;
  16. --f7-appbar-inner-padding-right: 8px;
  17. }
  18. .md {
  19. --f7-appbar-height: 48px;
  20. --f7-appbar-inner-padding-left: 16px;
  21. --f7-appbar-inner-padding-right: 16px;
  22. }
  23. .aurora {
  24. --f7-appbar-height: 38px;
  25. --f7-appbar-inner-padding-left: 15px;
  26. --f7-appbar-inner-padding-right: 15px;
  27. }

Examples

  1. <div id="#app">
  2. <!-- Appbar -->
  3. <div class="appbar">
  4. <div class="appbar-inner">
  5. <div class="left">
  6. <a href="#" class="button button-small panel-toggle display-flex" data-panel="left">
  7. <i class="f7-icons">bars</i>
  8. </a>
  9. <a href="#" class="button button-small display-flex margin-left-half">
  10. <i class="f7-icons">reply_fill</i>
  11. </a>
  12. <a href="#" class="button button-small display-flex margin-left-half">
  13. <i class="f7-icons">forward_fill</i>
  14. </a>
  15. </div>
  16. <div class="right">
  17. <div class="searchbar searchbar-inline">
  18. <div class="searchbar-input-wrap">
  19. <input type="text" placeholder="Search app">
  20. <i class="searchbar-icon"></i>
  21. <div class="input-clear-button"></div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <!-- Rest of the app -->
  28. <div class="view view-main view-init">
  29. <div class="page">
  30. <div class="navbar">
  31. <div class="navbar-inner">
  32. <div class="title">Badge</div>
  33. </div>
  34. </div>
  35. <div class="page-content">
  36. ...
  37. </div>
  38. </div>
  39. </div>
  40. </div>