Skip to content

Sidebar with a calendar

A sidebar with a calendar.

Preview

Open the screen alone (new tab)

Built with

The components this screen renders, through their own templates. Changing one of them, or a token they read, changes this screen.

Design system gaps

What the design system lacks to render the original as it is. The screen fills each gap with native HTML on semantic tokens until a component or a token covers it.

  • Collapsing the sidebar (off canvas or to an icon rail) has no pattern without script yet.
  • The month calendar is a static native table on semantic tokens: there is no Calendar component, so days cannot be selected and the month cannot change.
  • Collapsible groups are native details elements on semantic tokens: there is no Disclosure component yet.
  • Menus whose trigger is a whole row (team, version or user switcher) use the Dropdown next to the row: its trigger is a Button with a text label, it cannot hold an avatar or two lines.

Changes from the original

  • The sidebar does not collapse (that needs script, and so does the trigger button): it is always expanded on wide screens and stacks above the content on narrow ones. The sidebar trigger and its separator are dropped.
  • The rail that resizes the sidebar is dropped.
  • The calendar shows October 2024 with today on the 8th: the original shows the current month. The previous and next month buttons are dropped (changing month needs script), and days are text, not buttons.
  • Calendars are checkboxes (the original draws a checked square inside a menu button).
  • The sidebar is a complementary region named "Calendars" (it holds a calendar and settings, not navigation).
  • Rebuilt as static HTML with the design system's component templates; every color, type style, radius, border and spacing comes from its tokens.
  • The original visual design (Tailwind classes, the Geist font) is not reused.
  • Lucide and Tabler icons are remapped to Material Symbols; brand logos (Apple, Google, GitHub, Meta) are dropped, the buttons keep their text.
  • Placeholder images are drawn with semantic tokens.
  • No script: behaviour that needs JavaScript (collapsing the sidebar, toasts, drag and drop, client-side tables) is dropped or simplified, and each screen says so.

Code

The HTML the screen renders, from apps/docs/screens/shadcn-ui/sidebar-12.screen.mjs, with the stylesheets of @quantum-ds/tokens, the reference implementation (packages/components/src/) and apps/docs/screens/screens.css.

HTML
<div class="scr-viewport">
  <div class="scr-screen">
    <div class="scr-shell" data-variant="sidebar" data-side="left">
      <aside class="scr-sidebar" aria-label="Calendars">
        <div class="scr-sidebar__header">
          <div class="scr-identity">
            <span
              class="ds-avatar"
              data-size="small"
              data-shape="square"
              aria-hidden="true"
            >
              <span
                class="ds-avatar__initials"
                data-part="initials"
                aria-hidden="true"
              >S</span>
            </span>
            <span class="scr-identity__text">
              <span class="scr-identity__title">shadcn</span>
              <span class="scr-identity__subtitle">m@example.com</span>
            </span>
            <div class="ds-dropdown">
              <button
                type="button"
                class="ds-button ds-dropdown__trigger"
                data-emphasis="ghost"
                data-intent="neutral"
                data-size="xsmall"
                data-part="trigger"
                id="sidebar-12-user-trigger"
                popovertarget="sidebar-12-user"
              >
                <span
                  class="ds-button__label"
                  data-part="label"
                >Account</span>
                <span
                  class="ds-button__icon"
                  data-part="icon"
                  data-position="end"
                  aria-hidden="true"
                >expand_more</span>
              </button>
              <div
                class="ds-dropdown__menu"
                data-part="menu"
                id="sidebar-12-user"
                popover
                aria-labelledby="sidebar-12-user-trigger"
              >
                <ul class="ds-dropdown__group" data-part="group">
                  <li>
                    <button
                      type="button"
                      class="ds-dropdown__item"
                      data-part="item"
                      data-intent="neutral"
                      popovertarget="sidebar-12-user"
                      popovertargetaction="hide"
                    >
                      <span
                        class="ds-dropdown__item-icon"
                        data-part="item-icon"
                        aria-hidden="true"
                      >auto_awesome</span>
                      <span
                        class="ds-dropdown__item-label"
                        data-part="item-label"
                      >Upgrade to Pro</span>
                    </button>
                  </li>
                </ul>
                <hr
                  class="ds-dropdown__separator"
                  data-part="separator"
                >
                <ul class="ds-dropdown__group" data-part="group">
                  <li>
                    <button
                      type="button"
                      class="ds-dropdown__item"
                      data-part="item"
                      data-intent="neutral"
                      popovertarget="sidebar-12-user"
                      popovertargetaction="hide"
                    >
                      <span
                        class="ds-dropdown__item-icon"
                        data-part="item-icon"
                        aria-hidden="true"
                      >verified</span>
                      <span
                        class="ds-dropdown__item-label"
                        data-part="item-label"
                      >Account</span>
                    </button>
                  </li>
                  <li>
                    <button
                      type="button"
                      class="ds-dropdown__item"
                      data-part="item"
                      data-intent="neutral"
                      popovertarget="sidebar-12-user"
                      popovertargetaction="hide"
                    >
                      <span
                        class="ds-dropdown__item-icon"
                        data-part="item-icon"
                        aria-hidden="true"
                      >credit_card</span>
                      <span
                        class="ds-dropdown__item-label"
                        data-part="item-label"
                      >Billing</span>
                    </button>
                  </li>
                  <li>
                    <button
                      type="button"
                      class="ds-dropdown__item"
                      data-part="item"
                      data-intent="neutral"
                      popovertarget="sidebar-12-user"
                      popovertargetaction="hide"
                    >
                      <span
                        class="ds-dropdown__item-icon"
                        data-part="item-icon"
                        aria-hidden="true"
                      >notifications</span>
                      <span
                        class="ds-dropdown__item-label"
                        data-part="item-label"
                      >Notifications</span>
                    </button>
                  </li>
                </ul>
                <hr
                  class="ds-dropdown__separator"
                  data-part="separator"
                >
                <ul class="ds-dropdown__group" data-part="group">
                  <li>
                    <button
                      type="button"
                      class="ds-dropdown__item"
                      data-part="item"
                      data-intent="neutral"
                      popovertarget="sidebar-12-user"
                      popovertargetaction="hide"
                    >
                      <span
                        class="ds-dropdown__item-icon"
                        data-part="item-icon"
                        aria-hidden="true"
                      >logout</span>
                      <span
                        class="ds-dropdown__item-label"
                        data-part="item-label"
                      >Log out</span>
                    </button>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
        <div class="scr-sidebar__content">
          <hr class="ds-divider" data-orientation="horizontal">
          <table class="scr-calendar">
            <caption class="scr-calendar__caption">October 2024</caption>
            <thead>
              <tr>
                <th scope="col">
                  <span aria-hidden="true">Su</span>
                  <span class="scr-sr">Sunday</span>
                </th>
                <th scope="col">
                  <span aria-hidden="true">Mo</span>
                  <span class="scr-sr">Monday</span>
                </th>
                <th scope="col">
                  <span aria-hidden="true">Tu</span>
                  <span class="scr-sr">Tuesday</span>
                </th>
                <th scope="col">
                  <span aria-hidden="true">We</span>
                  <span class="scr-sr">Wednesday</span>
                </th>
                <th scope="col">
                  <span aria-hidden="true">Th</span>
                  <span class="scr-sr">Thursday</span>
                </th>
                <th scope="col">
                  <span aria-hidden="true">Fr</span>
                  <span class="scr-sr">Friday</span>
                </th>
                <th scope="col">
                  <span aria-hidden="true">Sa</span>
                  <span class="scr-sr">Saturday</span>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td class="scr-calendar__day" data-outside>
                  <time datetime="2024-09-29">29</time>
                </td>
                <td class="scr-calendar__day" data-outside>
                  <time datetime="2024-09-30">30</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-01">1</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-02">2</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-03">3</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-04">4</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-05">5</time>
                </td>
              </tr>
              <tr>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-06">6</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-07">7</time>
                </td>
                <td class="scr-calendar__day" aria-current="date">
                  <time datetime="2024-10-08">8</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-09">9</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-10">10</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-11">11</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-12">12</time>
                </td>
              </tr>
              <tr>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-13">13</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-14">14</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-15">15</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-16">16</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-17">17</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-18">18</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-19">19</time>
                </td>
              </tr>
              <tr>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-20">20</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-21">21</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-22">22</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-23">23</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-24">24</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-25">25</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-26">26</time>
                </td>
              </tr>
              <tr>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-27">27</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-28">28</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-29">29</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-30">30</time>
                </td>
                <td class="scr-calendar__day">
                  <time datetime="2024-10-31">31</time>
                </td>
                <td class="scr-calendar__day" data-outside>
                  <time datetime="2024-11-01">1</time>
                </td>
                <td class="scr-calendar__day" data-outside>
                  <time datetime="2024-11-02">2</time>
                </td>
              </tr>
            </tbody>
          </table>
          <hr class="ds-divider" data-orientation="horizontal">
          <div class="scr-nav-group">
            <details open>
              <summary class="scr-nav__summary">
                <span class="scr-nav__label">My Calendars</span>
                <span class="scr-nav__chevron">
                  <span
                    class="ds-icon"
                    data-size="small"
                    data-color="current"
                    aria-hidden="true"
                  >chevron_right</span>
                </span>
              </summary>
              <ul class="scr-checklist">
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-personal"
                      name="calendars"
                      value="personal"
                      checked
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-personal"
                    >Personal</label>
                  </div>
                </li>
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-work"
                      name="calendars"
                      value="work"
                      checked
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-work"
                    >Work</label>
                  </div>
                </li>
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-family"
                      name="calendars"
                      value="family"
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-family"
                    >Family</label>
                  </div>
                </li>
              </ul>
            </details>
          </div>
          <hr class="ds-divider" data-orientation="horizontal">
          <div class="scr-nav-group">
            <details>
              <summary class="scr-nav__summary">
                <span class="scr-nav__label">Favorites</span>
                <span class="scr-nav__chevron">
                  <span
                    class="ds-icon"
                    data-size="small"
                    data-color="current"
                    aria-hidden="true"
                  >chevron_right</span>
                </span>
              </summary>
              <ul class="scr-checklist">
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-holidays"
                      name="calendars"
                      value="holidays"
                      checked
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-holidays"
                    >Holidays</label>
                  </div>
                </li>
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-birthdays"
                      name="calendars"
                      value="birthdays"
                      checked
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-birthdays"
                    >Birthdays</label>
                  </div>
                </li>
              </ul>
            </details>
          </div>
          <hr class="ds-divider" data-orientation="horizontal">
          <div class="scr-nav-group">
            <details>
              <summary class="scr-nav__summary">
                <span class="scr-nav__label">Other</span>
                <span class="scr-nav__chevron">
                  <span
                    class="ds-icon"
                    data-size="small"
                    data-color="current"
                    aria-hidden="true"
                  >chevron_right</span>
                </span>
              </summary>
              <ul class="scr-checklist">
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-travel"
                      name="calendars"
                      value="travel"
                      checked
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-travel"
                    >Travel</label>
                  </div>
                </li>
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-reminders"
                      name="calendars"
                      value="reminders"
                      checked
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-reminders"
                    >Reminders</label>
                  </div>
                </li>
                <li>
                  <div class="ds-checkbox" data-size="small">
                    <input
                      type="checkbox"
                      class="ds-checkbox__control"
                      data-part="control"
                      id="sidebar-12-calendar-deadlines"
                      name="calendars"
                      value="deadlines"
                    >
                    <label
                      class="ds-checkbox__label"
                      data-part="label"
                      for="sidebar-12-calendar-deadlines"
                    >Deadlines</label>
                  </div>
                </li>
              </ul>
            </details>
          </div>
          <hr class="ds-divider" data-orientation="horizontal">
        </div>
        <div class="scr-sidebar__footer">
          <button
            type="button"
            class="ds-button"
            data-emphasis="ghost"
            data-intent="neutral"
            data-size="small"
          >
            <span
              class="ds-button__icon"
              data-part="icon"
              data-position="start"
              aria-hidden="true"
            >add</span>
            <span
              class="ds-button__label"
              data-part="label"
            >New Calendar</span>
          </button>
        </div>
      </aside>
      <div class="scr-main">
        <header class="scr-header" data-sticky>
          <nav
            class="ds-breadcrumb"
            aria-label="Breadcrumb"
            data-size="small"
          >
            <ol class="ds-breadcrumb__list" data-part="list">
              <li class="ds-breadcrumb__item" data-part="item">
                <span
                  class="ds-breadcrumb__link"
                  data-part="link"
                  aria-current="page"
                >October 2024</span>
              </li>
            </ol>
          </nav>
        </header>
        <main class="scr-content">
          <h1 class="scr-sr">October 2024</h1>
          <div class="scr-tile-grid" aria-hidden="true">
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
            <div class="scr-tile"></div>
          </div>
        </main>
      </div>
    </div>
  </div>
</div>