# App bar

The top bar of an application: brand, navigation links, then search, action buttons, the theme switch and the user, in five looks; the links fold into a menu when they do not fit.

Block: `smbk-app-bar`. Status: candidate. Figma: the Figma file, https://www.figma.com/community/file/1688324308358870630. Desktop and mobile: differ by presentation only.

## Options

| Axis | Values | Default | Meaning |
|---|---|---|---|
| `look` | `floating`, `floating-hug`, `flat`, `split`, `centred` | `floating` | Floating: a raised bar with rounded corners and a hairline edge, the links in the true middle. Floating hug: the same bar only as wide as its content, centered. Flat: a square bar with no edge or shadow, a line along its foot. Split: the brand on an island of its own at the start, the links and the end group on one at the end. Centred: the links at the start, the brand in the middle. Figma calls this Style. |
| `size` | `md`, `lg` | `md` | How large the links in the wide bar are. md is Figma's: the middle navigation item. lg is the large item, as the bar drew them before. The menu keeps its large items either way. |
| `background` | `on`, `off` | `on` | The bar's own surface. Off drops its fill, edge and shadow so it sits on whatever is behind it; the open menu keeps its surface, as Figma draws the open bar only with one, and a bar that hides on scroll takes the page's own surface while it sticks. Figma: Background (on by default). |
| `line` | `on`, `off` | `on` | The hairline along the foot of a flat bar. Only the flat look draws it. Figma: Line (on by default). |
| `logo` | `on`, `off` | `on` | The brand at the start of the bar in a wide space. Off drops it, for a page whose logo sits elsewhere, such as at the top of a sidebar that runs the page's full height; the links then start the bar, and a badge stays. The narrow bar keeps its logo either way. |
| `links` | `between`, `start`, `end` | `between` | Where the links sit in a wide space. Between: in the middle of the bar, as Figma draws it. Start: right after the brand, the free room after them, as the Showroom App bar draws them. End: pushed to the end, just before the search, buttons and theme switch, for a bar laid over a page whose middle is its own, such as a home page with a large picture behind it. Start and end are not in the App bar component in Figma. The menu is the same either way. |
| `nav-type` | `links`, `tabs` | `links` | How the wide bar draws its links. Links: navigation items. Tabs: small line tabs that fill the bar's whole height, the current page's underline on the bar's foot; the bar is then 64 tall. Either way they are links, the current one marked as the current page, and the menu lists them as navigation items. Figma: AppBarNav's Type. |
| `fold` | `none`, `actions`, `links` | `none` | What has folded away in a wide space too narrow for the whole row. Actions: the action buttons are gone. Links: the actions and the links are gone and the menu button shows, opening the links under the bar. The wrapper measures the row and sets it; markup written by hand sets it the same way. |
| `expanded` | on / off | off | The menu is open under the bar: in a narrow space, or in a wide one whose links have folded away. |
| `hide-on-scroll` | on / off | off | In a narrow space, the bar stays at the top of the window while the page scrolls, slides up out of sight as the reader scrolls down and comes back as they scroll up. For a page that scrolls the window; turned on page by page. Has no effect in a wide space. Not in Figma. |
| `scrolled-away` | on / off | off | The bar has slid up out of sight. The wrapper sets it while the reader scrolls down a page with hide on scroll on; plain markup sets it the same way. Has no effect without hide on scroll or in a wide space. |
| `zone` | on / off | off | The bar's own room, as Figma draws it: the medium inset above and below a floating bar and a step in from the sides, and its row held to the content width. Off by default, so a page that already leaves room around its bar keeps its own. |
| `sidebar-start` | on / off | off | In a wide space the start is as wide as the expanded sidebar, its logo the sidebar's logo size and in line with the sidebar's rows, so links that follow it (links start) begin where the page beside a sidebar begins. For a bar across the top of a page with a sidebar under it at the same side gutter as the bar's own inset. Not in the App bar component in Figma; drawn in the Showroom App bar. |
| `frosted` | on / off | off | A blur behind the bar, strongest at the top and gone by its foot, so what scrolls under it is never read sharply there. For a bar with its background off, or with its own room. Not drawn when the system asks for forced colors. |

Parts: `smbk-app-bar__panel`, `smbk-app-bar__frost`, `smbk-app-bar__bar`, `smbk-app-bar__start`, `smbk-app-bar__brand`, `smbk-app-bar__logo`, `smbk-app-bar__badge`, `smbk-app-bar__title`, `smbk-app-bar__trail`, `smbk-app-bar__nav`, `smbk-app-bar__end`, `smbk-app-bar__search`, `smbk-app-bar__actions`, `smbk-app-bar__divider`, `smbk-app-bar__menu-button`, `smbk-app-bar__second-row`, `smbk-app-bar__second-row-nav`, `smbk-app-bar__menu`, `smbk-app-bar__menu-end`, `smbk-app-bar__wide-only`, `smbk-app-bar__narrow-only`

## Markup

```html
<header class="smbk-app-bar smbk-app-bar--look-floating smbk-app-bar--size-md smbk-app-bar--background-on smbk-app-bar--line-on smbk-app-bar--logo-on smbk-app-bar--links-between smbk-app-bar--nav-type-links smbk-app-bar--fold-none">
  <div class="smbk-app-bar__panel">
    <div class="smbk-app-bar__bar">
      <div class="smbk-app-bar__start">
        <a class="smbk-app-bar__brand" href="/">
          <svg
            class="smbk-logo smbk-logo--brand-simbolik smbk-logo--form-logo smbk-logo--source-shapes smbk-app-bar__logo smbk-app-bar__wide-only"
            viewBox="0 0 173 32"
            role="img"
            aria-label="Simbolik"
          ><path class="smbk-logo__mark" d="M10.5947 8.62609V0.417391C10.5947 0.186873 10.782 0 11.0129 0H12.6858C12.9168 0 13.104 0.186872 13.104 0.417391V8.62609C13.104 10.3934 14.5395 11.8261 16.3103 11.8261H37.0814C37.3124 11.8261 37.4996 12.013 37.4996 12.2435V13.913C37.4996 14.1436 37.3124 14.3304 37.0814 14.3304H16.3103C13.1537 14.3304 10.5947 11.7765 10.5947 8.62609Z"></path><path class="smbk-logo__mark" d="M26.905 23.3739V31.5826C26.905 31.8131 26.7177 32 26.4867 32H24.8139C24.5829 32 24.3957 31.8131 24.3957 31.5826V23.3739C24.3957 21.6066 22.9602 20.1739 21.1894 20.1739L0.418272 20.1739C0.1873 20.1739 6.10177e-05 19.987 6.10352e-05 19.7565L6.11612e-05 18.0869C6.11787e-05 17.8564 0.187301 17.6696 0.418272 17.6696L21.1894 17.6696C24.346 17.6696 26.905 20.2235 26.905 23.3739Z"></path><path class="smbk-logo__type" d="M53.9717 23.6522C52.201 23.6522 50.776 23.5933 49.6967 23.4755C48.6259 23.3577 47.8122 23.1389 47.2557 22.8192C46.7076 22.4994 46.3366 22.045 46.1427 21.456C45.9572 20.8669 45.8644 20.1012 45.8644 19.1587H48.1916C48.1916 19.6888 48.2296 20.118 48.3055 20.4462C48.3814 20.7659 48.5964 21.0142 48.9505 21.1909C49.3047 21.3592 49.878 21.477 50.6706 21.5443C51.4717 21.6032 52.5931 21.6327 54.0349 21.6327C55.5611 21.6327 56.7458 21.6032 57.589 21.5443C58.4406 21.477 59.0519 21.3592 59.4229 21.1909C59.7939 21.0142 60.0174 20.7617 60.0933 20.4336C60.1776 20.1054 60.2197 19.672 60.2197 19.1335C60.2197 18.4771 60.1607 17.9848 60.0427 17.6567C59.9246 17.3285 59.6464 17.1097 59.2079 17.0003C58.7695 16.8825 58.0696 16.8194 57.1084 16.811L51.3157 16.7478C49.8232 16.731 48.6849 16.6048 47.9007 16.3692C47.1166 16.1336 46.5812 15.7212 46.2945 15.1322C46.0078 14.5347 45.8644 13.689 45.8644 12.5951C45.8644 11.5769 46.0204 10.7901 46.3324 10.2347C46.6528 9.67935 47.1503 9.28385 47.8249 9.04823C48.4994 8.81262 49.3763 8.67377 50.4556 8.6317C51.5349 8.58121 52.8376 8.55597 54.3638 8.55597C56.1598 8.55597 57.5848 8.61066 58.6388 8.72006C59.7012 8.82945 60.4938 9.03561 61.0166 9.33855C61.5478 9.64148 61.8935 10.0833 62.0537 10.6639C62.2223 11.2361 62.3066 11.985 62.3066 12.9107H59.9794C59.9794 12.3637 59.9415 11.9345 59.8656 11.6232C59.7897 11.3034 59.5831 11.072 59.2459 10.929C58.917 10.7775 58.3774 10.6807 57.6269 10.6386C56.8849 10.5966 55.8394 10.5755 54.4903 10.5755C52.9557 10.5755 51.7626 10.5924 50.9109 10.626C50.0593 10.6597 49.4438 10.7396 49.0643 10.8658C48.6849 10.9921 48.453 11.194 48.3687 11.4717C48.2844 11.741 48.2422 12.1155 48.2422 12.5951C48.2422 13.0832 48.2675 13.4703 48.3181 13.7564C48.3771 14.034 48.5247 14.2444 48.7608 14.3875C48.9969 14.5305 49.3805 14.6273 49.9118 14.6778C50.4514 14.7199 51.2018 14.7451 52.1631 14.7535L57.159 14.804C58.6598 14.8208 59.7981 14.9471 60.5739 15.1827C61.358 15.4099 61.8893 15.8348 62.1675 16.4575C62.4542 17.0718 62.5975 17.9638 62.5975 19.1335C62.5975 20.1853 62.4415 21.0142 62.1296 21.6201C61.826 22.2259 61.337 22.6761 60.6624 22.9706C59.9879 23.2567 59.0983 23.4419 57.9937 23.526C56.8976 23.6102 55.5569 23.6522 53.9717 23.6522Z"></path><path class="smbk-logo__type" d="M65.848 23.3746V9.64148H68.2764V23.3746H65.848Z"></path><path class="smbk-logo__type" d="M71.5649 23.3746V8.83366H73.9932V10.6386C74.3558 10.1506 74.7901 9.74246 75.296 9.41428C75.8019 9.0861 76.4469 8.84207 77.2311 8.68219C78.0237 8.51389 79.0355 8.42974 80.2666 8.42974C81.7927 8.42974 83.0364 8.6359 83.9977 9.04823C84.9589 9.46056 85.6672 10.1716 86.1225 11.1814C86.5357 10.5419 87.0332 10.0202 87.615 9.61624C88.1968 9.20391 88.9261 8.90518 89.803 8.72006C90.6884 8.52651 91.7761 8.42974 93.0662 8.42974C94.6008 8.42974 95.8487 8.64011 96.8099 9.06086C97.7712 9.47319 98.4752 10.18 98.9221 11.1814C99.3775 12.1828 99.6051 13.5544 99.6051 15.2963V23.3746H97.1767V15.2963C97.1767 13.9667 97.0376 12.9569 96.7593 12.2669C96.4811 11.5685 96.0173 11.0931 95.3681 10.8406C94.7273 10.5797 93.8588 10.4493 92.7626 10.4493C90.6125 10.4493 89.0779 10.7649 88.1588 11.396C87.2482 12.0271 86.7929 13.0579 86.7929 14.4885V14.4758C86.8013 14.7367 86.8055 15.0102 86.8055 15.2963V23.3746H84.3771V15.2963C84.3771 13.9667 84.238 12.9569 83.9597 12.2669C83.6815 11.5685 83.2177 11.0931 82.5685 10.8406C81.9277 10.5797 81.0592 10.4493 79.963 10.4493C77.8129 10.4493 76.2783 10.7649 75.3592 11.396C74.4486 12.0271 73.9932 13.0579 73.9932 14.4885V23.3746H71.5649Z"></path><path class="smbk-logo__type" d="M111.772 23.6522C110.212 23.6522 108.893 23.5344 107.814 23.2988C106.743 23.0632 105.9 22.5331 105.284 21.7084V23.3746H102.856V0H105.284V10.4872C105.9 9.67094 106.743 9.14501 107.814 8.90939C108.893 8.67377 110.212 8.55597 111.772 8.55597C113.408 8.55597 114.791 8.64011 115.921 8.80841C117.059 8.97671 117.978 9.3133 118.678 9.8182C119.378 10.3231 119.888 11.072 120.208 12.065C120.529 13.0579 120.689 14.3791 120.689 16.0284C120.689 17.7282 120.529 19.0872 120.208 20.1054C119.888 21.1236 119.378 21.8893 118.678 22.4026C117.978 22.9075 117.059 23.2399 115.921 23.3998C114.791 23.5681 113.408 23.6522 111.772 23.6522ZM118.261 16.0284C118.261 14.825 118.197 13.8615 118.071 13.1379C117.953 12.4142 117.687 11.8714 117.274 11.5096C116.861 11.1393 116.216 10.8911 115.339 10.7649C114.471 10.6386 113.282 10.5755 111.772 10.5755C110.398 10.5755 109.285 10.6386 108.433 10.7649C107.582 10.8911 106.928 11.1393 106.473 11.5096C106.018 11.8714 105.706 12.4142 105.537 13.1379C105.368 13.8615 105.284 14.825 105.284 16.0284C105.284 17.2738 105.368 18.2709 105.537 19.0199C105.706 19.7688 106.018 20.3326 106.473 20.7112C106.928 21.0815 107.582 21.3297 108.433 21.456C109.285 21.5738 110.398 21.6327 111.772 21.6327C113.282 21.6327 114.471 21.5738 115.339 21.456C116.216 21.3297 116.861 21.0815 117.274 20.7112C117.687 20.3326 117.953 19.7688 118.071 19.0199C118.197 18.2709 118.261 17.2738 118.261 16.0284Z"></path><path class="smbk-logo__type" d="M132.034 23.6522C130.407 23.6522 129.024 23.5681 127.886 23.3998C126.747 23.2399 125.828 22.9075 125.128 22.4026C124.429 21.8893 123.918 21.1236 123.598 20.1054C123.278 19.0872 123.117 17.7282 123.117 16.0284C123.117 14.3791 123.278 13.0579 123.598 12.065C123.918 11.072 124.429 10.3231 125.128 9.8182C125.828 9.3133 126.747 8.97671 127.886 8.80841C129.024 8.64011 130.407 8.55597 132.034 8.55597C133.67 8.55597 135.053 8.64011 136.183 8.80841C137.321 8.97671 138.24 9.3133 138.94 9.8182C139.64 10.3231 140.15 11.072 140.47 12.065C140.791 13.0579 140.951 14.3791 140.951 16.0284C140.951 17.7282 140.791 19.0872 140.47 20.1054C140.15 21.1236 139.64 21.8893 138.94 22.4026C138.24 22.9075 137.321 23.2399 136.183 23.3998C135.053 23.5681 133.67 23.6522 132.034 23.6522ZM138.523 16.0284C138.523 14.825 138.459 13.8615 138.333 13.1379C138.215 12.4142 137.949 11.8714 137.536 11.5096C137.123 11.1393 136.478 10.8911 135.601 10.7649C134.732 10.6386 133.543 10.5755 132.034 10.5755C130.533 10.5755 129.344 10.6386 128.467 10.7649C127.591 10.8911 126.946 11.1393 126.532 11.5096C126.119 11.8714 125.849 12.4142 125.723 13.1379C125.605 13.8615 125.546 14.825 125.546 16.0284C125.546 17.2738 125.605 18.2709 125.723 19.0199C125.849 19.7688 126.119 20.3326 126.532 20.7112C126.946 21.0815 127.591 21.3297 128.467 21.456C129.344 21.5738 130.533 21.6327 132.034 21.6327C133.543 21.6327 134.732 21.5738 135.601 21.456C136.478 21.3297 137.123 21.0815 137.536 20.7112C137.949 20.3326 138.215 19.7688 138.333 19.0199C138.459 18.2709 138.523 17.2738 138.523 16.0284Z"></path><path class="smbk-logo__type" d="M144.65 32V9.6H147.141L147.078 32H144.65Z"></path><path class="smbk-logo__type" d="M151.069 23.3746V9.64148H153.498V23.3746H151.069Z"></path><path class="smbk-logo__type" d="M156.811 23.3746V0H159.24V15.1827L168.915 8.83366H172.596L162.313 15.6623L173.001 23.3746H169.383L159.24 15.9148V23.3746H156.811Z"></path><path class="smbk-logo__type" d="M151.069 7.09569V4.52174H153.498V7.09569H151.069Z"></path><path class="smbk-logo__type" d="M65.88 7.37395V4.8H68.3084V7.37395H65.88Z"></path></svg>
          <svg
            class="smbk-logo smbk-logo--brand-simbolik smbk-logo--form-logomark smbk-logo--source-shapes smbk-app-bar__logo smbk-app-bar__narrow-only"
            viewBox="0 0 38 32"
            role="img"
            aria-label="Simbolik"
          >
            <path
              class="smbk-logo__mark"
              d="M10.5947 8.62609V0.417391C10.5947 0.186873 10.782 0 11.0129 0H12.6858C12.9168 0 13.104 0.186872 13.104 0.417391V8.62609C13.104 10.3934 14.5395 11.8261 16.3103 11.8261H37.0814C37.3124 11.8261 37.4996 12.013 37.4996 12.2435V13.913C37.4996 14.1436 37.3124 14.3304 37.0814 14.3304H16.3103C13.1537 14.3304 10.5947 11.7765 10.5947 8.62609Z"
            ></path>
            <path
              class="smbk-logo__mark"
              d="M26.905 23.3739V31.5826C26.905 31.8131 26.7177 32 26.4867 32H24.8139C24.5829 32 24.3957 31.8131 24.3957 31.5826V23.3739C24.3957 21.6066 22.9602 20.1739 21.1894 20.1739L0.418272 20.1739C0.1873 20.1739 6.10177e-05 19.987 6.10352e-05 19.7565L6.11612e-05 18.0869C6.11787e-05 17.8564 0.187301 17.6696 0.418272 17.6696L21.1894 17.6696C24.346 17.6696 26.905 20.2235 26.905 23.3739Z"
            ></path>
          </svg>
        </a>
      </div>
      <div class="smbk-app-bar__trail">
        <nav aria-label="Main" class="smbk-app-bar__nav smbk-app-bar__wide-only">
          <a class="smbk-nav-item smbk-nav-item--size-md" href="#home">
            <i
              class="ph ph-house smbk-icon smbk-icon--size-md smbk-nav-item__icon"
              aria-hidden="true"
            ></i>
            <span class="smbk-nav-item__label" data-label="Home">Home</span>
          </a>
          <a class="smbk-nav-item smbk-nav-item--size-md" href="#projects" aria-current="page">
            <i
              class="ph ph-folder-simple smbk-icon smbk-icon--size-md smbk-nav-item__icon"
              aria-hidden="true"
            ></i>
            <span class="smbk-nav-item__label" data-label="Projects">Projects</span>
          </a>
          <a class="smbk-nav-item smbk-nav-item--size-md" href="#reports">
            <i
              class="ph ph-chart-bar smbk-icon smbk-icon--size-md smbk-nav-item__icon"
              aria-hidden="true"
            ></i>
            <span class="smbk-nav-item__label" data-label="Reports">Reports</span>
          </a>
        </nav>
        <div class="smbk-app-bar__end">
          <div class="smbk-app-bar__search smbk-app-bar__wide-only"><span class="smbk-input smbk-input--size-md smbk-search smbk-search--size-md"><i class="ph ph-magnifying-glass smbk-icon smbk-icon--size-md smbk-input__icon" aria-hidden="true"></i><input type="search" class="smbk-input__control smbk-search__control" placeholder="Search..." aria-label="Search"/><kbd class="smbk-kbd smbk-kbd--size-sm smbk-search__kbd" aria-hidden="true">⌘ K</kbd></span></div>
          <button
            type="button"
            class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-md smbk-btn--icon-only smbk-app-bar__narrow-only"
            aria-label="Search"
          >
            <i
              class="ph ph-magnifying-glass smbk-icon smbk-icon--size-md smbk-btn__icon"
              aria-hidden="true"
            ></i>
          </button>
          <div class="smbk-app-bar__actions smbk-app-bar__wide-only">
            <button
              type="button"
              class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-md smbk-btn--icon-only"
              aria-label="Notifications"
            >
              <i
                class="ph ph-bell-ringing smbk-icon smbk-icon--size-md smbk-btn__icon"
                aria-hidden="true"
              ></i>
            </button>
            <button
              type="button"
              class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-md smbk-btn--icon-only"
              aria-label="Settings"
            >
              <i
                class="ph ph-gear smbk-icon smbk-icon--size-md smbk-btn__icon"
                aria-hidden="true"
              ></i>
            </button>
          </div>
          <div class="smbk-app-bar__wide-only">
            <div
              role="radiogroup"
              aria-label="Theme"
              class="smbk-theme-switch smbk-segmented smbk-segmented--size-md smbk-segmented--look-theme"
            >
              <span class="smbk-segmented__indicator" aria-hidden="true"></span>
              <label class="smbk-segmented__item">
                <input
                  type="radio"
                  class="smbk-segmented__control"
                  aria-label="Dark theme"
                  name="theme"
                  value="dark"
                >
                <i
                  class="ph ph-moon-stars smbk-icon smbk-icon--size-md smbk-segmented__icon"
                  aria-hidden="true"
                ></i>
                <span class="smbk-tooltip__layer"><span role="tooltip" id="react-aria-app-bar-1" aria-hidden="true" class="smbk-tooltip smbk-tooltip--arrow-top-center smbk-tooltip--inverse" hidden=""><span class="smbk-tooltip__bubble">Dark theme</span><span class="smbk-tooltip__arrow" aria-hidden="true"></span></span></span>
              </label>
              <label class="smbk-segmented__item">
                <input
                  type="radio"
                  class="smbk-segmented__control"
                  aria-label="Light theme"
                  name="theme"
                  checked=""
                  value="light"
                >
                <i
                  class="ph ph-sun smbk-icon smbk-icon--size-md smbk-segmented__icon"
                  aria-hidden="true"
                ></i>
                <span class="smbk-tooltip__layer"><span role="tooltip" id="react-aria-app-bar-2" aria-hidden="true" class="smbk-tooltip smbk-tooltip--arrow-top-center smbk-tooltip--inverse" hidden=""><span class="smbk-tooltip__bubble">Light theme</span><span class="smbk-tooltip__arrow" aria-hidden="true"></span></span></span>
              </label>
            </div>
          </div>
          <span class="smbk-avatar smbk-avatar--size-md smbk-avatar--tone-default smbk-avatar--type-image">
            <img
              class="smbk-avatar__image"
              src="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22270%22%3E%3Crect%20width%3D%22480%22%20height%3D%22270%22%20fill%3D%22%235c7798%22%2F%3E%3Ccircle%20cx%3D%22360%22%20cy%3D%2290%22%20r%3D%2260%22%20fill%3D%22%23cc0d0d%22%2F%3E%3C%2Fsvg%3E"
              alt="Maya Chen"
            >
          </span>
          <button
            type="button"
            class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-md smbk-btn--icon-only smbk-app-bar__menu-button smbk-app-bar__narrow-only"
            aria-label="Menu"
            aria-expanded="false"
            aria-controls="app-bar-3-menu"
          >
            <i
              class="ph ph-list smbk-icon smbk-icon--size-md smbk-btn__icon"
              aria-hidden="true"
            ></i>
          </button>
        </div>
      </div>
    </div>
    <div id="app-bar-3-menu" class="smbk-app-bar__menu">
      <nav aria-label="Menu"><a class="smbk-nav-item smbk-nav-item--size-lg smbk-nav-item--block" href="#home"><i class="ph ph-house smbk-icon smbk-icon--size-md smbk-nav-item__icon" aria-hidden="true"></i><span class="smbk-nav-item__label" data-label="Home">Home</span></a><a class="smbk-nav-item smbk-nav-item--size-lg smbk-nav-item--block" href="#projects" aria-current="page"><i class="ph ph-folder-simple smbk-icon smbk-icon--size-md smbk-nav-item__icon" aria-hidden="true"></i><span class="smbk-nav-item__label" data-label="Projects">Projects</span></a><a class="smbk-nav-item smbk-nav-item--size-lg smbk-nav-item--block" href="#reports"><i class="ph ph-chart-bar smbk-icon smbk-icon--size-md smbk-nav-item__icon" aria-hidden="true"></i><span class="smbk-nav-item__label" data-label="Reports">Reports</span></a></nav>
      <div class="smbk-app-bar__menu-end">
        <div
          role="radiogroup"
          aria-label="Theme"
          class="smbk-theme-switch smbk-segmented smbk-segmented--size-md smbk-segmented--look-theme"
        >
          <span class="smbk-segmented__indicator" aria-hidden="true"></span>
          <label class="smbk-segmented__item">
            <input
              type="radio"
              class="smbk-segmented__control"
              aria-label="Dark theme"
              name="theme-menu"
              value="dark"
            >
            <i
              class="ph ph-moon-stars smbk-icon smbk-icon--size-md smbk-segmented__icon"
              aria-hidden="true"
            ></i>
            <span class="smbk-tooltip__layer"><span role="tooltip" id="react-aria-app-bar-4" aria-hidden="true" class="smbk-tooltip smbk-tooltip--arrow-top-center smbk-tooltip--inverse" hidden=""><span class="smbk-tooltip__bubble">Dark theme</span><span class="smbk-tooltip__arrow" aria-hidden="true"></span></span></span>
          </label>
          <label class="smbk-segmented__item">
            <input
              type="radio"
              class="smbk-segmented__control"
              aria-label="Light theme"
              name="theme-menu"
              checked=""
              value="light"
            >
            <i
              class="ph ph-sun smbk-icon smbk-icon--size-md smbk-segmented__icon"
              aria-hidden="true"
            ></i>
            <span class="smbk-tooltip__layer"><span role="tooltip" id="react-aria-app-bar-5" aria-hidden="true" class="smbk-tooltip smbk-tooltip--arrow-top-center smbk-tooltip--inverse" hidden=""><span class="smbk-tooltip__bubble">Light theme</span><span class="smbk-tooltip__arrow" aria-hidden="true"></span></span></span>
          </label>
        </div>
      </div>
    </div>
  </div>
</header>
```

## React

```tsx
import { AppBar } from './design-system/components/app-bar/app-bar.js';
import { SearchField } from './design-system/components/search-field/search-field.js';
import { Button } from './design-system/components/button/button.js';
import { ThemeSwitch } from './design-system/components/theme-switch/theme-switch.js';
import { Avatar } from './design-system/components/avatar/avatar.js';

<AppBar search={<SearchField placeholder="Search..." aria-label="Search" shortcut="⌘ K" onClear={() => {}} />} actions={<Button tone="ghost" size="md" icon="BellRinging" icon-only aria-label="Notifications" />
<Button tone="ghost" size="md" icon="Gear" icon-only aria-label="Settings" />} themeSwitch={<ThemeSwitch size="md" />} user={<Avatar size="md" src="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22480%22%20height%3D%22270%22%3E%3Crect%20width%3D%22480%22%20height%3D%22270%22%20fill%3D%22%235c7798%22%2F%3E%3Ccircle%20cx%3D%22360%22%20cy%3D%2290%22%20r%3D%2260%22%20fill%3D%22%23cc0d0d%22%2F%3E%3C%2Fsvg%3E" alt="Maya Chen" />} items={[{ label: "Home", href: "#home", icon: "House" }, { label: "Projects", href: "#projects", icon: "FolderSimple", active: true }, { label: "Reports", href: "#reports", icon: "ChartBar" }]} onSearch={() => {}} background="on" logo="on" links="between" look="floating" size="md" line="on" nav-type="links" fold="none" />
```

## Stylesheet

```css
/* smbk-app-bar — App bar. Figma "App bar" 7353:700 (Style × Platform × State), built from AppBarStart,
 * AppBarNav and AppBarEnd.
 * The top bar of an application: the start (the brand and a badge), the links in the middle, then at the end
 * the search field, action buttons, the theme switch and the user. In a narrow space the links, search and
 * actions give way to a search button and a menu button, and the menu button opens a stacked list under the
 * bar. Which form shows is the layout switch, never a width written here. In a wide space too narrow for the
 * whole row the wrapper folds the actions away, then the links, and the menu button opens them (fold).
 *
 * What the app bar shares with the header, which is built from the same parts, is written once in
 * ../bar/bar.css: the bar and its surface, the five looks, the zone, the frost, the second row, the row's common
 * arrangement and the open menu's movement. This stylesheet keeps what is the app bar's own. */

.smbk-app-bar__second-row {
  padding: 0 calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline)) calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
}

.smbk-app-bar--look-split .smbk-app-bar__second-row {
  padding: calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
}

/* ==== The app bar's own row ==== */

/* Figma draws the bar's edge inside it (56 tall with a medium control between two medium insets), so each padding
   here gives the edge's width back; the same in the narrow bar and its menu. The row clips what it cannot hold
   until the page's script has measured it, so the page never scrolls sideways. */
.smbk-app-bar__bar {
  display: flex;
  justify-content: space-between;
  gap: var(--smbk-space-inline-lg);
  padding: calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
}

/* The links sit in the true middle, as Figma draws them: the start and the end share what the links leave
   equally; where there is too little room each end keeps what its content needs and the links move off the middle
   rather than overlap. An end group holding a search field keeps the bar's room on either side of the links
   instead, because there the search field narrows first. Markup without a start part keeps the room on either
   side too. */
.smbk-app-bar__start,
.smbk-app-bar__start ~ .smbk-app-bar__trail > .smbk-app-bar__end {
  flex: 1 1 0;
}

.smbk-app-bar__bar:has(.smbk-app-bar__search) > .smbk-app-bar__start {
  flex: 0 0 auto;
}

.smbk-app-bar__badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* A title in the bar, after a back button at the start or alone in the middle, as Figma's AppBarStart Back and
   AppBarNav Title draw it: Label LG in the default text color, on one line. */
.smbk-app-bar__title {
  overflow: hidden;
  color: var(--smbk-color-text-default);
  font-family: var(--smbk-typography-label-lg-font-family);
  font-size: var(--smbk-typography-label-lg-font-size);
  font-weight: var(--smbk-typography-label-lg-font-weight);
  line-height: var(--smbk-typography-label-lg-line-height);
  letter-spacing: var(--smbk-typography-label-lg-letter-spacing);
  text-transform: var(--smbk-typography-label-lg-text-transform);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The links (their row is in bar.css) never shrink. */
.smbk-app-bar__nav {
  flex-shrink: 0;
}

/* Links at the end: the free room goes before them instead of on either side, so they sit
   against the end group, the bar's own gap apart. */
.smbk-app-bar--links-end .smbk-app-bar__nav {
  margin-inline-start: auto;
}

.smbk-app-bar--links-end .smbk-app-bar__end,
.smbk-app-bar--links-end .smbk-app-bar__start ~ .smbk-app-bar__trail > .smbk-app-bar__end {
  flex: 0 1 auto;
}

/* Everything after the links, the small inline step apart. When space runs short, the search field is what gives;
   what still does not fit runs on past the end, where the bar clips it and its script sees it to fold, never back
   over the logo (safe). */
.smbk-app-bar__end {
  justify-content: safe flex-end;
  flex: 0 1 auto;
  min-width: 0;
}

/* Beside the links in the true middle, the end group keeps all it holds; it narrows only once everything that can
   fold has folded. */
.smbk-app-bar__start ~ .smbk-app-bar__trail > .smbk-app-bar__end {
  min-width: auto;
}

.smbk-app-bar__bar:has(.smbk-app-bar__search) .smbk-app-bar__end,
.smbk-app-bar--fold-links .smbk-app-bar__end {
  flex: 0 1 auto;
  min-width: 0;
}

.smbk-app-bar__search {
  flex: 0 1 auto;
  width: var(--smbk-size-search-width);
  min-width: 0;
  /* Narrowed past its icon and hint, it keeps them inside its own sides rather than over its neighbours; its
     shadow still shows below it. */
  overflow-x: clip;
}

.smbk-app-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--smbk-space-inline-sm);
  flex-shrink: 0;
}

.smbk-app-bar__end > :not(.smbk-app-bar__search) {
  flex-shrink: 0;
}

.smbk-app-bar__divider {
  height: var(--smbk-size-control-md);
}

/* The open menu, as Figma's open mobile app bar draws it: the links with their icons, each row a medium control
   tall and the extra-small stack step apart, then the theme switch at the end; the medium inset at the sides and
   above the menu's foot, no dividers. */
.smbk-app-bar__menu {
  gap: var(--smbk-space-stack-xs);
  padding: 0 calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
}

.smbk-app-bar__menu nav {
  display: flex;
  flex-direction: column;
  gap: var(--smbk-space-stack-xs);
}

/* The theme switch at the menu's end shows only in the narrow form, where the bar has none of its own. */
.smbk-app-bar__menu-end {
  display: none;
  justify-content: flex-end;
}

/* ---- the looks' rows ---- */

/* Floating hug: none of the three places grows. */
.smbk-app-bar--look-floating-hug .smbk-app-bar__start,
.smbk-app-bar--look-floating-hug .smbk-app-bar__start ~ .smbk-app-bar__trail > .smbk-app-bar__end {
  flex: 0 0 auto;
}

/* Split: each island has the bar's padding. */
.smbk-app-bar--look-split .smbk-app-bar__start,
.smbk-app-bar--look-split .smbk-app-bar__trail {
  flex: 0 0 auto;
  padding: calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
}

.smbk-app-bar--look-split .smbk-app-bar__start ~ .smbk-app-bar__trail > .smbk-app-bar__end {
  flex: 0 1 auto;
}

/* Centred: the links at the start, the brand in the middle, the end at the end. */
.smbk-app-bar--look-centred .smbk-app-bar__nav {
  order: 1;
  flex: 1 1 0;
}

.smbk-app-bar--look-centred .smbk-app-bar__start {
  order: 2;
  flex: 0 0 auto;
}

.smbk-app-bar--look-centred .smbk-app-bar__end {
  order: 3;
}

/* ---- fold: in a wide space too narrow for the whole row, the actions go first, then the links, and the menu
   button takes their place, opening the links under the bar. The wrapper measures and sets it. The selectors
   carry the block so they outweigh the narrow form's rules for the menu button. ---- */

.smbk-app-bar--fold-actions .smbk-app-bar__actions,
.smbk-app-bar--fold-links .smbk-app-bar__actions,
.smbk-app-bar--fold-links .smbk-app-bar__nav {
  display: none;
}

/* ---- the two forms (the shared parts are in bar.css): the open menu's foot padding after a fold. ---- */

.smbk-app-bar--fold-links.smbk-app-bar--expanded .smbk-app-bar__menu {
  padding-bottom: calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
}

/* Logo off: the wide bar starts with its links and keeps its end group at the end, even with no
   links; a badge stays at the start. The narrow bar keeps its logo. */
.smbk-app-bar--logo-off .smbk-app-bar__brand,
.smbk-app-bar--logo-off .smbk-app-bar__start:not(:has(.smbk-app-bar__badge)) {
  display: none;
}

.smbk-app-bar--logo-off .smbk-app-bar__start {
  flex: 0 0 auto;
}

.smbk-app-bar--logo-off .smbk-app-bar__end {
  margin-inline-start: auto;
}

@container style(--smbk-layout: narrow) {
  .smbk-app-bar--logo-off .smbk-app-bar__brand {
    display: inline-flex;
  }

  .smbk-app-bar--logo-off .smbk-app-bar__start:not(:has(.smbk-app-bar__badge)) {
    display: flex;
  }
}

/* ---- the wide bar's arrangements from the Showroom App bar (Figma 8061:17018). Each is wide only: the narrow bar
   keeps its own form. ---- */

@container style(--smbk-layout: wide) {
  /* Links start: the links right after the start and the free room after them, the start keeping only its own
     width rather than sharing the room with the end. */
  .smbk-app-bar--links-start .smbk-app-bar__start {
    flex: 0 0 auto;
  }

  .smbk-app-bar--links-start .smbk-app-bar__nav {
    margin-inline-end: auto;
  }

  /* Sidebar start: the start and the bar's gap after it as wide as the expanded sidebar, so the links begin at the
     sidebar's edge; the logo a medium inset in, where the sidebar's rows begin, at the sidebar's own logo size. It
     lines up when the bar's side inset is the page's gutter, as a flat bar's across a page with a medium inset
     gutter is. */
  .smbk-app-bar--sidebar-start .smbk-app-bar__start {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: calc(var(--smbk-size-sidebar-width) - var(--smbk-space-inline-lg));
    padding-inline-start: var(--smbk-space-inset-md);
  }

  .smbk-app-bar--sidebar-start .smbk-app-bar__logo {
    height: var(--smbk-size-icon-lg);
  }

  /* Nav type tabs: the links are small line tabs filling the bar's whole height, 64 with its edge, with no padding
     above or below. The tabs reach over the bar's edge, so the current page's underline lies on the bar's foot line,
     as Figma draws it; the bar's foot is their line, so the tabs draw none of their own. */
  .smbk-app-bar--nav-type-tabs .smbk-app-bar__bar {
    height: calc(var(--smbk-size-64) - 2 * var(--smbk-border-width-hairline));
    padding-block: 0;
  }

  .smbk-app-bar--nav-type-tabs .smbk-app-bar__nav.smbk-tabs {
    align-self: stretch;
    align-items: stretch;
    margin-block: calc(-1 * var(--smbk-border-width-hairline));
  }

  .smbk-app-bar--nav-type-tabs .smbk-app-bar__nav.smbk-tabs > .smbk-tabs__list {
    height: auto;
    box-shadow: none;
  }
}

/* The narrow bar as Figma draws it: the medium inset all round, the row a medium control tall, the brand and the
   end group at its two ends. */
@container style(--smbk-layout: narrow) {
  .smbk-app-bar__bar {
    padding: calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
  }

  .smbk-app-bar__menu-end {
    display: flex;
  }

  .smbk-app-bar--expanded .smbk-app-bar__menu {
    padding-bottom: calc(var(--smbk-space-inset-md) - var(--smbk-border-width-hairline));
  }

  /* Floating hug: the places share the row. */
  .smbk-app-bar--look-floating-hug .smbk-app-bar__start,
  .smbk-app-bar--look-floating-hug .smbk-app-bar__start ~ .smbk-app-bar__trail > .smbk-app-bar__end {
    flex: 1 1 0;
  }

}

/* ---- hide on scroll: in a narrow space, a bar with the flag on stays at the top of the window, the
   medium inset from its edge (the room a page leaves around its bar), over the page as it scrolls under it.
   The wrapper marks it scrolled away while the reader scrolls down: it slides up past the window's edge,
   by the gap above it and a large inset more so its shadow goes too, with the exit motion, and comes back
   with the enter motion. It sticks inside the element around it, so that element must run the page's
   length. At once under reduced motion. A wide space, where the page scrolls an inner area, keeps the
   bar as it is. ---- */

@container style(--smbk-layout: narrow) {
  .smbk-app-bar--hide-on-scroll {
    position: sticky;
    top: var(--smbk-space-inset-md);
    z-index: var(--smbk-layer-sticky);
    transition: translate var(--smbk-motion-enter-duration) var(--smbk-motion-enter-easing);
  }

  .smbk-app-bar--hide-on-scroll.smbk-app-bar--scrolled-away {
    translate: 0 calc(-100% - var(--smbk-space-inset-md) - var(--smbk-space-inset-lg));
    transition-duration: var(--smbk-motion-exit-duration);
    transition-timing-function: var(--smbk-motion-exit-easing);
  }

  /* A flat bar runs edge to edge, so it sticks flush with the window's top, with no room above it. */
  .smbk-app-bar--hide-on-scroll.smbk-app-bar--look-flat {
    top: 0;
  }

  /* With its background off, a bar that sticks takes the page's own surface, still with no edge or shadow, so it
     looks as it does at rest on the page while the page scrolls under it, and nothing shows through it. */
  .smbk-app-bar--hide-on-scroll.smbk-app-bar--background-off:not(.smbk-app-bar--expanded) {
    background: var(--smbk-color-surface-canvas);
  }
}

@media (prefers-reduced-motion: reduce) {
  .smbk-app-bar--hide-on-scroll {
    transition: none;
  }
}

/* While a page holds a bar that sticks, the window keeps the bar's room clear at its top whenever it
   scrolls to bring something into view: a focused link, or a heading jumped to from a link to it. So
   nothing lands under the bar. The room is the header height and the gap above the bar. In a wide
   space, where the bar does not stick, the window keeps the same room, which only moves a jumped-to
   heading a little further down. */
:root:has(.smbk-app-bar--hide-on-scroll) {
  scroll-padding-block-start: calc(var(--smbk-size-header-height) + var(--smbk-space-inset-md));
}

/* The open menu starts from no height and no foot padding, so both grow (the movement is in bar.css). It comes
   after the foot padding it replaces, which the starting style only overrides when it is the later rule. */
@starting-style {
  .smbk-app-bar--expanded .smbk-app-bar__menu {
    block-size: 0;
    padding-bottom: 0;
  }
}
```

## Tokens it reads

```json
{
  "border-width": {
    "hairline": {
      "$type": "dimension",
      "$value": "{{border-width.1}}",
      "$description": "Thin lines: dividers and almost every edge."
    }
  },
  "color": {
    "border": {
      "rim": {
        "$type": "color",
        "$value": "{{color.alpha.white.90}}",
        "$description": "The light rim that makes a surface look lit: fields, chosen pills, cards."
      },
      "subtle": {
        "$type": "color",
        "$value": "{{color.grey.300}}",
        "$description": "Dividers and quiet edges."
      },
      "focus": {
        "$type": "color",
        "$value": "{{color.red.600}}",
        "$description": "Keyboard focus ring on controls."
      }
    },
    "surface": {
      "default": {
        "$type": "color",
        "$value": "{{color.grey.100}}",
        "$description": "Standard surface: cards, panels, the header."
      },
      "canvas": {
        "$type": "color",
        "$value": "{{color.grey.200}}",
        "$description": "Page background."
      }
    },
    "text": {
      "default": {
        "$type": "color",
        "$value": "{{color.grey.900}}",
        "$description": "Main text."
      }
    }
  },
  "radius": {
    "container": {
      "sm": {
        "$type": "dimension",
        "$value": "{{radius.8}}",
        "$description": "Corners of cards, panels and dialogs, small."
      }
    },
    "control": {
      "xs": {
        "$type": "dimension",
        "$value": "{{radius.2}}",
        "$description": "Corners of controls, extra small."
      }
    }
  },
  "elevation": {
    "raised": {
      "$type": "shadow",
      "$value": {
        "light": "0px 2px 8px 1px #373d431a, 0px 1px 2px 0px #373d431a",
        "dark": "0px 2px 8px 1px #00000026, 0px 1px 2px 0px #00000026"
      }
    }
  },
  "motion": {
    "state": {
      "duration": {
        "$type": "duration",
        "$value": "{{duration.200}}"
      },
      "easing": {
        "$type": "cubicBezier",
        "$value": "{{easing.cubic-in-out}}"
      }
    },
    "enter": {
      "duration": {
        "$type": "duration",
        "$value": "{{duration.320}}"
      },
      "easing": {
        "$type": "cubicBezier",
        "$value": "{{easing.expo-out}}"
      }
    },
    "exit": {
      "duration": {
        "$type": "duration",
        "$value": "{{duration.200}}"
      },
      "easing": {
        "$type": "cubicBezier",
        "$value": "{{easing.expo-in}}"
      }
    }
  },
  "space": {
    "0": {
      "$type": "dimension",
      "$value": "0px",
      "$description": "Raw space step, 0 px. Only for fixed distances inside a component; spacing that follows density uses space/inset, stack or inline."
    },
    "inset": {
      "md": {
        "$type": "dimension",
        "$value": "{{space.8}}",
        "$description": "Padding inside a component, medium."
      },
      "2xl": {
        "$type": "dimension",
        "$value": "{{space.24}}",
        "$description": "Padding inside a component, 2× large."
      },
      "lg": {
        "$type": "dimension",
        "$value": "{{space.12}}",
        "$description": "Padding inside a component, large."
      }
    },
    "gutter": {
      "xs": {
        "$type": "dimension",
        "$value": "{{space.8}}",
        "$description": "A section’s outer side padding on a phone (space/layout/gutter points here). The page itself has no gutter: each section carries its own."
      }
    },
    "stack": {
      "sm": {
        "$type": "dimension",
        "$value": "{{space.8}}",
        "$description": "Gap between things stacked one above another, small."
      },
      "md": {
        "$type": "dimension",
        "$value": "{{space.12}}",
        "$description": "Gap between things stacked one above another, medium."
      },
      "xs": {
        "$type": "dimension",
        "$value": "{{space.4}}",
        "$description": "Gap between things stacked one above another, extra small."
      }
    },
    "inline": {
      "lg": {
        "$type": "dimension",
        "$value": "{{space.12}}",
        "$description": "Gap between things side by side, large."
      },
      "md": {
        "$type": "dimension",
        "$value": "{{space.8}}",
        "$description": "Gap between things side by side, medium."
      },
      "xs": {
        "$type": "dimension",
        "$value": "{{space.4}}",
        "$description": "Gap between things side by side, extra small."
      },
      "sm": {
        "$type": "dimension",
        "$value": "{{space.6}}",
        "$description": "Gap between things side by side, small."
      },
      "2xl": {
        "$type": "dimension",
        "$value": "{{space.24}}",
        "$description": "Gap between things side by side, 2× large."
      }
    }
  },
  "size": {
    "64": {
      "$type": "dimension",
      "$value": "64px",
      "$description": "Raw size step, 64 px. Only for fixed sizes inside a component; semantic sizes (size/control, icon, mark) point here."
    },
    "layout": {
      "container": {
        "default": {
          "$type": "dimension",
          "$value": "{{size.layout.container.3xl}}",
          "$description": "The default page container max width: 3xl, 1360 px. Full width (the space available) is the Fill sizing in Figma and size/layout/container/full (100%) in code, which Figma cannot hold as a number."
        }
      }
    },
    "control": {
      "md": {
        "$type": "dimension",
        "$value": "{{size.40}}",
        "$description": "Height of a medium control, where controls insert by default: 40 comfortable, 32 compact. Dashboard recipe: use compact density; 40 for the page’s one main action and for forms; 32 for toolbars and filters, the size used most; 28 for actions inside table rows and cards. On phones switch to comfortable density, or give small controls an invisible 44 px tap area (size/target/comfortable)."
      }
    },
    "icon": {
      "xl": {
        "$type": "dimension",
        "$value": "{{size.32}}",
        "$description": "Icon box, extra large."
      },
      "lg": {
        "$type": "dimension",
        "$value": "{{size.24}}",
        "$description": "Icon box, large."
      }
    },
    "target": {
      "comfortable": {
        "$type": "dimension",
        "$value": "{{size.44}}",
        "$description": "Comfortable touch target (44)."
      }
    },
    "search": {
      "width": {
        "$type": "dimension",
        "$value": "320px",
        "$description": "Width of the search field in the wide app bar. A fixed frame width in Figma with no variable behind it; it should become one."
      }
    },
    "sidebar": {
      "width": {
        "$type": "dimension",
        "$value": "280px",
        "$description": "Width of the expanded sidebar. Not a step on any primitive scale."
      }
    },
    "header": {
      "height": {
        "$type": "dimension",
        "$value": "{{size.56}}",
        "$description": "The sticky header’s height, for scroll padding so a focused item is never hidden under it: 56 on a phone, 80 on a desktop. Each value points to a density token, so compact density still applies."
      }
    }
  },
  "blur": {
    "4": {
      "$type": "dimension",
      "$value": "4px",
      "$description": "Raw blur, 4 px."
    },
    "8": {
      "$type": "dimension",
      "$value": "8px",
      "$description": "Raw blur, 8 px."
    },
    "14": {
      "$type": "dimension",
      "$value": "14px",
      "$description": "Raw blur, 14 px."
    }
  },
  "focus": {
    "ring": {
      "width": {
        "$type": "dimension",
        "$value": "{{border-width.2}}",
        "$description": "Thickness of the focus ring."
      },
      "offset": {
        "$type": "dimension",
        "$value": "{{space.2}}",
        "$description": "Gap between a control and its focus ring."
      }
    }
  },
  "typography": {
    "label-lg": {
      "$type": "typography",
      "$value": {
        "fontFamily": "Geist, Geist Fallback, system-ui, sans-serif",
        "fontSize": "16px",
        "fontWeight": 500,
        "lineHeight": 1.4,
        "letterSpacing": "0px"
      },
      "$description": "Label LG: labels on controls and short UI text (buttons, chips, tabs, menu headings). Geist Medium, sentence case. Code and keys use Code SM and Code MD."
    }
  },
  "layer": {
    "sticky": {
      "$type": "number",
      "$value": 1100
    }
  }
}
```

## Purpose

The bar across the top of an application screen: the brand, the main links, and at the end a search field, a couple of action buttons, the theme switch and the signed-in user. It is for a product someone is working in. The header is its cousin for a marketing or documentation site; the two share their looks and their parts.

## Anatomy

- The block, a raised bar with a hairline edge. With the background off it has no fill, edge or shadow and sits on the page behind it; the open menu keeps its surface.
- Five looks: floating (the default), floating hug (only as wide as its content, centered), flat (square, no edge or shadow, a hairline along its foot that the line setting turns off), split (the start on an island of its own, the links and the end on another) and centred (the links at the start, the brand in the middle).
- The panel part: the bar's surface when the bar has its own room or a frost; otherwise it is no box and the block draws the surface.
- The bar part, the row: the start part (the brand part with the logo part, then an optional badge part), the trail part holding the nav part (navigation items with their icons and any count or dot, the same links drawn as line tabs, or other content in their place) and the end part (the search part, the actions part, the theme switch and the user; a search button, in a narrow space, or in a wide one with no search field; and in a narrow space or once the links have folded the menu button part).
- The logo part is the built-in simbolik logo, or a site's own picture files with their dark versions (`logoPicture`, the logo's `picture`): the whole logo in a wide space and the mark in a narrow one. Anything else goes in the brand's place (`brand`), or in the whole start's place (`start`), such as a back button and a title part.
- The second row part, under the bar: a divider and the second row nav part, a row a control tall for further navigation such as line tabs.
- The menu part, under the bar when expanded: the links as large navigation items each filling its row, and in a narrow space the theme switch at the end.
- The frost parts, three layers behind the bar when frosted.

## When to use

- The top of every screen of an application.

## When not to use

- A website. Use the [header](header.md), which has the same looks.
- Inside a page. It is page chrome, not content.

## Behavior

One markup serves both forms. In a wide space the links sit in the true middle of the bar: the start and the end share what the links leave equally, and where there is too little room each end keeps what it holds and the links move off the middle rather than overlap. Set to the start, the links follow the start and the free room comes after them. Set to the end, the links sit against the end group. An end group holding a search field keeps the same room on either side of the links instead, and there the search field narrows first. In a narrow space the links, the search field and the action buttons are removed and replaced by a search button and a menu button, and the menu button stacks the links under the bar. The form follows the layout switch, so a wrapper can force either. The menu state can be controlled from outside or left to the bar. Escape closes the open menu and puts focus back on the menu button. The menu grows open under the bar with the enter motion and closes a little faster with the exit motion; under reduced motion it opens and closes at once.

In a wide space too narrow for the whole row, the bar folds parts away rather than cutting them off: first the action buttons, then the links, whose place the menu button takes; it opens them under the bar. The bar measures its own row whenever its size or content changes and once the fonts have loaded, and keeps the least folded form that fits, so the links come back as soon as there is room. Only links fold: content passed in their place stays. Before the page's script runs the row clips what it cannot hold, so the page never scrolls sideways. `fold={false}` keeps every part in the row; a stage (`"actions"`, `"links"`) holds the bar there. Markup written by hand sets the fold modifier itself.

The bar can have its own room (`zone`): the medium inset above and below a floating bar and a step in from the sides, a smaller one in a narrow space, and none around a flat bar; past the content width its row stays that wide and centered while the surface runs on. It is off by default, so a page that already leaves room around its bar keeps its own. A frosted bar has a blur behind it, strongest at the top and gone by its foot, so what scrolls under it is never read sharply there; it shows where the bar has no background of its own, or in its room, and is not drawn when the system asks for forced colors.

The links can be drawn as tabs (`nav-type="tabs"`): small line tabs that fill the wide bar's whole height, the current page's brand underline lying on the bar's foot, the bar then 64 tall. They are still links, the current page marked, and the menu lists them as navigation items as before. Over a page with a sidebar under the bar, the start can be as wide as the expanded sidebar (`sidebar-start`), its logo the sidebar's logo size and in line with the sidebar's rows, so links set to the start begin at the sidebar's edge. That lines up when the bar's side inset is the page's gutter, as a flat bar's across a page with the medium inset gutter is. Both change the wide bar only.

The logo can be turned off for the wide bar, for a page whose logo sits elsewhere, such as at the top of a sidebar that runs the page's full height: the links then start the bar, a badge stays, and the end group keeps its place. The narrow bar keeps its logo whatever the setting, because there the page's other logo is usually gone with its sidebar.

A page that scrolls the window can turn on hide on scroll, page by page. In a narrow space the bar then stays at the top of the window while the page scrolls under it, slides up out of sight as the reader scrolls down, and comes back as soon as they scroll up, so the menu and search are never more than a small scroll away. It ignores moves of a few pixels, stays while the page is still within the bar's own height of the top, never hides while one of its menus is open or keyboard focus is inside it, and comes back the moment keyboard focus moves into it. It slides away with the exit motion and back with the enter motion; under reduced motion it hides and shows at once. A flat bar sticks flush with the window's top, and a bar with its background off takes the page's own surface while it sticks, still with no edge or shadow, so nothing shows through it. While such a bar is on the page, the window keeps the bar's room clear at its top whenever it scrolls to bring something into view, a link reached with Tab or a heading jumped to, so nothing lands under the bar. A wide space keeps the bar as it is. A page that is one screen by design, such as a home page, leaves it off.

A page can take the menu over (`onMenu`): the menu button then calls the page instead of opening the bar's own menu, and the bar draws no menu, so the page opens its own, such as a drawer holding the links and more. The button then says it opens a dialog rather than that it is expanded. On a phone, for example, a drawer can hold the site's sections and its whole category tree, with the theme switch in the drawer's foot.

Hide on scroll needs the bar to stick to the top of the window, and a sticking element cannot leave the element around it. Place the bar straight in the page's column, or give a wrapper that holds only the bar `display: contents` in a narrow space.

## Accessibility

### What it does for you

- The bar is a banner landmark. The links in the bar are a navigation landmark named "Main" by default, and the menu links one named "Menu". Drawn as tabs they are the same links in the same navigation, never a tab list.
- A link's count and dot are part of its name, after a pause: "Issues, 18".
- The current page's link carries the current-page marker, and its label is a weight step bolder as well as filled.
- The menu button carries its expanded state and names the menu it controls; the search button is named "Search". Escape closes the open menu and returns focus to the menu button.
- Parts hidden by the layout switch or folded away are removed from the tab order, so nothing is reachable that cannot be seen.
- A badge after the brand is read after it.
- In the centred look the brand is still first in reading and Tab order, before the links that are drawn to its left.
- A bar that has scrolled out of sight comes back the moment keyboard focus moves into it, and stays while focus is inside it, so a keyboard user never works in a bar they cannot see.

### What you must do

- Give the links another name when a page has more than one bar.
- Put something with an accessible name in the user slot, for example an avatar with the person's name.
- Give the words the bar says by itself, such as the menu button's and the search button's names, in the page's own language. They keep their English unless the page gives its own.

### How to test

- Tab through the bar: focus moves in the order it is read, the focus ring shows in both themes and in a forced-color mode, and nothing hidden takes focus.
- Open the menu with Enter or Space, then press Escape: it closes and focus is back on the menu button.
- With a screen reader, the bar is read as a banner with a "Main" navigation, the current page is announced as current, and a link's count is read after its label.
- With text at 200% and the page 320 pixels wide, the bar folds to its menu and every link stays reachable.
- On a page that scrolls, scroll the bar out of sight, then Tab into it: it comes back.

### Keyboard

| Key | What it does |
|---|---|
| Tab | Moves focus through the visible links and buttons in reading order. |
| Shift + Tab | Moves focus back through them. |
| Enter | Follows a link, or presses the menu button or the search button. |
| Space | Presses the menu button or the search button. |
| Escape | Closes the open menu and returns focus to the menu button. |

## Usage rules

### Do

- Give the user slot a way to sign out.
- Keep the links to the few that matter most; the same list fills the menu.
- Give every link an icon, or none.
- Turn on the bar's own room only where the page leaves none around it, so the space is never doubled.

### Don't

- Put more than two or three action buttons in it. Move the rest behind a menu.
- Rely on the action buttons in a narrow space or a crowded wide one: they fold away, so anything they do must be reachable elsewhere too.
