kitbash Sign in Connect agent
Components

Showcase with progress tabs

A dotted grey field with an app window in a selection frame; three tabs below advance on a 4s progress line and crossfade the window's contents. Click a tab to jump.

Part of the style

Selection Frame Lab

6 parts that belong together, with their tokens, type and rules.

Preview

Code
<style>
/* Goes after the pack's base.css */
@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..700&family=Fraunces:ital,opsz,wght@1,9..144,400..600&display=swap");
:root {
  --paper: #aac4e8;
  --ink: #07121e;
  --muted: #485b75;
  --hairline: #485b75;
  --surface-active: #a2bbde;
  --surface-inset: #a4bee1;
  --night: #2a394b;
  --night-line: #38495d;
  --disabled: #95adce;
  --grid-line: rgba(106, 125, 153, 0.16);
  --dot: rgba(106, 125, 153, 0.45);
  --accent: #73859b;
  --accent-hover: #728294;
  --alert: #46576b;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
}
</style>

<section class="solutions" aria-labelledby="solutions-title">
  <span class="solutions__cross solutions__cross--left" aria-hidden="true">+</span>
  <span class="solutions__cross solutions__cross--right" aria-hidden="true">+</span>

  <header class="solutions__head">
    <h2 class="solutions__title" id="solutions-title"><span class="solutions__label">Solutions</span> Where drawings meet the workshop.</h2>
    <p class="solutions__intro">The same model draws inside a chat, fills a build sheet for the shop floor and powers a size picker on a frame builder's store. More places soon; the first public model ships this winter.</p>
  </header>

  <div class="solutions__stage">
    <div class="solutions__frame">
      <span class="solutions__handle solutions__handle--nw"></span><span class="solutions__handle solutions__handle--ne"></span><span class="solutions__handle solutions__handle--sw"></span><span class="solutions__handle solutions__handle--se"></span>
      <div class="solutions__window">
        <aside class="solutions__side">
          <p class="solutions__app">Truss</p>
          <ul class="solutions__menu">
            <li class="solutions__place is-here">Chat</li><li class="solutions__place">Sheets</li><li class="solutions__place">Frames</li><li>Parts</li><li>Riders</li>
          </ul>
          <ul class="solutions__menu solutions__menu--end"><li>Settings</li><li>Log out</li></ul>
        </aside>
        <div class="solutions__main">

          <div class="solutions__view is-current" id="solutions-view-1" role="tabpanel" aria-labelledby="solutions-tab-1">
            <p class="solutions__bar"><span class="is-here">Chat</span><span>Project</span></p>
            <p class="solutions__ask">Draw a steel fork for a 700×40 tyre, 45 mm rake</p>
            <p class="solutions__reply">Here is a fork with a 45 mm rake and 395 mm axle to crown. Clearance is marked on the right.</p>
            <div class="solutions__card">
              <svg viewBox="0 0 160 112" aria-hidden="true">
                <text class="solutions__h" x="8" y="15">Fork, 45 mm rake</text>
                <path class="solutions__hair" d="M8 22H152M70 30V104M8 104H152"></path>
                <path class="solutions__tube" d="M60 30h22M71 30v10M71 40Q72 76 88 98"></path>
                <circle class="solutions__solid" cx="88" cy="98" r="2.5"></circle>
                <path class="solutions__acc" d="M71 98H88M71 95v6M88 95v6"></path>
                <path class="solutions__hair solutions__dash" d="M88 98V30M54.2 85.7A36 36 0 0 1 121.8 85.7"></path>
                <text class="solutions__t" x="91" y="94">45</text>
                <text class="solutions__t" x="100" y="44">Clearance 48</text>
                <text class="solutions__t solutions__t--mute" x="8" y="111">A–C 395</text>
              </svg>
              <div class="solutions__notes">
                <p><b>01</b> Crown</p><p><b>02</b> Blade bend</p><p><b>03</b> Dropout</p>
              </div>
            </div>
            <p class="solutions__input"><span>Write what to draw</span><span class="solutions__send">Send</span></p>
          </div>

          <div class="solutions__view" id="solutions-view-2" role="tabpanel" aria-labelledby="solutions-tab-2">
            <p class="solutions__bar"><span>Chat</span><span class="is-here">Sheets</span></p>
            <div class="solutions__sheet">
              <p class="solutions__doc-meta"><span>Build 0147</span><span>Shop copy</span></p>
              <p class="solutions__doc-title">Randonneur, 56</p>
              <div class="solutions__doc-cols">
                <ol class="solutions__list">
                  <li><span>01</span>Cut tubes to the list, mitre at 73.0° and 72.5°.</li>
                  <li><span>02</span>Braze lugs, check centre line on the table.</li>
                  <li><span>03</span>Rack bosses at 135 mm from the axle.</li>
                  <li><span>04</span>Fender eyes front and rear, M5.</li>
                </ol>
                <svg class="solutions__thumb" viewBox="0 0 120 90" aria-hidden="true">
                  <path class="solutions__hair" d="M0 80H120"></path>
                  <circle class="solutions__line" cx="26" cy="62" r="18"></circle><circle class="solutions__line" cx="94" cy="62" r="18"></circle>
                  <path class="solutions__tube" d="M50 66L39 30M40 32L84 31M50 66L86 36M50 66L26 62M40 34L26 62M86 36Q90 52 94 62M84 29L86 37"></path>
                  <path class="solutions__acc" d="M38 24H86"></path>
                </svg>
              </div>
              <p class="solutions__doc-foot"><span>Tube set 8/5/8</span><span>Weight 2.21 kg</span><span>Page 1 of 3</span></p>
            </div>
          </div>

          <div class="solutions__view" id="solutions-view-3" role="tabpanel" aria-labelledby="solutions-tab-3">
            <p class="solutions__bar"><span class="is-here">Frames</span><span>Cart (0)</span></p>
            <div class="solutions__shop">
              <svg class="solutions__product" viewBox="0 0 160 110" aria-hidden="true">
                <path class="solutions__hair" d="M4 100H156"></path>
                <circle class="solutions__line" cx="36" cy="76" r="24"></circle><circle class="solutions__line" cx="124" cy="76" r="24"></circle>
                <path class="solutions__tube solutions__tube--bold" d="M68 82L54 34M55 37L110 36M68 82L113 43M68 82L36 76M55 40L36 76M113 43Q118 62 124 76M110 34L113 44"></path>
              </svg>
              <div class="solutions__buy">
                <p class="solutions__name">Audax frame</p>
                <p class="solutions__price">€ 2,480</p>
                <p class="solutions__sizes"><span>52</span><span>54</span><span class="is-here">56</span><span>58</span></p>
                <p class="solutions__order">Order frame</p>
              </div>
            </div>
          </div>

        </div>
      </div>
    </div>
    <div class="solutions__track" aria-hidden="true"><span class="solutions__fill"></span></div>
  </div>

  <div class="solutions__tabs" role="tablist" aria-label="Where Truss draws">
    <button class="solutions__tab" id="solutions-tab-1" type="button" role="tab" aria-selected="true" aria-controls="solutions-view-1"><span class="solutions__tab-label">Assistants</span><span class="solutions__tab-text">Drawings inside your chat.</span></button>
    <button class="solutions__tab" id="solutions-tab-2" type="button" role="tab" aria-selected="false" aria-controls="solutions-view-2"><span class="solutions__tab-label">Build sheets</span><span class="solutions__tab-text">Shop-floor pages grounded in your specs.</span></button>
    <button class="solutions__tab" id="solutions-tab-3" type="button" role="tab" aria-selected="false" aria-controls="solutions-view-3"><span class="solutions__tab-label">Stores</span><span class="solutions__tab-text">Live frame drawings in your size picker.</span></button>
  </div>
</section>

<style>
  .solutions {
    --window-w: 520px;
    --window-h: 360px;
    position: relative;
    padding: 20px var(--edge) clamp(56px, 9.6vw, 139px);
    border-bottom: var(--rule) solid var(--hairline);
    background: var(--paper);
  }
  .solutions__cross {
    position: absolute;
    top: 0;
    font-size: var(--text-s);
    line-height: 1;
    translate: -50% -50%;
  }
  .solutions__cross--left { left: var(--edge); }
  .solutions__cross--right { left: calc(100% - var(--edge)); }

  .solutions__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-m) 48px;
    margin-bottom: clamp(40px, 7vw, 104px);
  }
  .solutions__title {
    max-width: 320px;
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 400;
    line-height: var(--leading);
    letter-spacing: var(--track-xl);
  }
  .solutions__label { display: block; color: var(--muted); }
  .solutions__intro { width: min(300px, 100%); margin: 26px 0 0; }

  .solutions__stage {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 973 / 545;
    min-height: 0;
    overflow: hidden;
    background:
      radial-gradient(circle, var(--dot) 0.75px, transparent 1px) 0 0 / 17px 17px,
      var(--surface-inset);
  }
  .solutions__frame {
    position: relative;
    padding: var(--handle-gap-y) var(--handle-gap-x);
  }
  .solutions__handle {
    position: absolute;
    width: var(--handle);
    height: var(--handle);
    translate: -50% -50%;
    border-radius: var(--radius-round);
    background: var(--ink);
  }
  .solutions__handle--nw { top: 0; left: 0; }
  .solutions__handle--ne { top: 0; left: 100%; }
  .solutions__handle--sw { top: 100%; left: 0; }
  .solutions__handle--se { top: 100%; left: 100%; }

  .solutions__window {
    display: grid;
    grid-template-columns: 118px 1fr;
    width: var(--window-w);
    height: var(--window-h);
    border: var(--rule) solid var(--hairline);
    background: var(--paper);
    transform-origin: 0 0;
    font-size: var(--text-nano);
    line-height: 1.5;
  }
  .solutions__side {
    display: flex;
    flex-direction: column;
    padding: 14px 12px;
    border-right: var(--rule) solid var(--disabled);
    background: var(--surface-inset);
  }
  .solutions__app { margin: 0 0 22px; font-size: var(--text-s); }
  .solutions__menu { margin: 0; padding: 0; list-style: none; color: var(--muted); line-height: 2.8; }
  .solutions__menu .is-here { color: var(--ink); }
  .solutions__place { transition: color var(--swap) var(--ease-std); }
  .solutions__menu--end { margin-top: auto; }

  .solutions__main { position: relative; }
  .solutions__view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 0 28px 14px;
    opacity: 0;
    transition: opacity var(--swap) var(--ease-std);
  }
  .solutions__view.is-current { opacity: 1; }
  .solutions__bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 0 -28px 18px;
    padding: 14px 0 12px;
    border-bottom: var(--rule) solid var(--disabled);
    color: var(--muted);
  }
  .solutions__bar .is-here { color: var(--ink); }
  .solutions__ask {
    align-self: flex-end;
    margin: 0 0 12px;
    padding: 5px 8px;
    background: var(--surface-inset);
  }
  .solutions__reply { max-width: 250px; margin: 0 0 6px; }
  .solutions__card {
    display: flex;
    gap: 8px;
    width: 230px;
    padding: 4px;
    border: var(--rule) solid var(--disabled);
  }
  .solutions__card svg { width: 160px; flex: none; }
  .solutions__notes { display: grid; align-content: start; gap: 6px; padding-top: 18px; font-size: var(--text-micro); }
  .solutions__notes p { margin: 0; }
  .solutions__notes b { display: block; font-weight: 400; font-size: var(--text-nano); }
  .solutions__input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: auto -28px -14px;
    padding: 8px 28px;
    border-top: var(--rule) solid var(--disabled);
    color: var(--disabled);
  }
  .solutions__send { padding: 2px 12px; border-radius: 99px; background: var(--surface-inset); color: var(--muted); }

  .solutions__sheet {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border: var(--rule) solid var(--disabled);
  }
  .solutions__doc-meta, .solutions__doc-foot {
    display: flex;
    justify-content: space-between;
    margin: 0;
    color: var(--muted);
    font-size: var(--text-micro);
  }
  .solutions__doc-title { margin: 6px 0 14px; font-size: var(--text-xxl); line-height: 1.1; letter-spacing: -0.01em; }
  .solutions__doc-cols { display: grid; grid-template-columns: 1fr 120px; gap: 16px; }
  .solutions__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .solutions__list li { display: grid; grid-template-columns: 22px 1fr; padding-bottom: 6px; border-bottom: var(--rule) solid var(--disabled); }
  .solutions__list span { font-size: var(--text-s); line-height: 1; }
  .solutions__doc-foot { margin-top: auto; }

  .solutions__shop { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: center; }
  .solutions__product { background: var(--surface-active); }
  .solutions__name { margin: 0; font-size: var(--text-s); }
  .solutions__price { margin: 2px 0 14px; color: var(--muted); font-size: var(--text-s); }
  .solutions__sizes { display: flex; margin: 0 0 10px; }
  .solutions__sizes span { flex: 1; padding: 4px 0; border: var(--rule) solid var(--hairline); text-align: center; }
  .solutions__sizes span + span { margin-left: calc(-1 * var(--rule)); }
  .solutions__sizes .is-here { background: var(--ink); color: var(--paper); }
  .solutions__order { margin: 0; padding: 7px 0; border: var(--rule) solid var(--hairline); background: var(--accent); text-align: center; }

  .solutions__h { fill: var(--ink); font-size: 8px; }
  .solutions__t { fill: var(--ink); font-size: 5px; }
  .solutions__t--mute { fill: var(--muted); }
  .solutions__hair { fill: none; stroke: var(--hairline); stroke-width: 0.4; }
  .solutions__dash { stroke-dasharray: 1.5 1.5; }
  .solutions__line { fill: none; stroke: var(--ink); stroke-width: 0.6; }
  .solutions__tube { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .solutions__tube--bold { stroke-width: 2.4; }
  .solutions__acc { fill: none; stroke: var(--accent); stroke-width: 1.2; }
  .solutions__solid { fill: var(--ink); }

  .solutions__track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(100% / 3);
    height: 1.5px;
    background: var(--disabled);
  }
  .solutions__fill { display: block; width: 0; height: 100%; background: var(--ink); }

  .solutions__tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
  .solutions__tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: var(--tap);
    padding: 0 36px 0 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
  }
  .solutions__tab-label { color: var(--muted); transition: color var(--quick) var(--ease-std); }
  .solutions__tab-text { max-width: 209px; margin-top: 2px; }
  .solutions__tab:hover .solutions__tab-label { color: var(--ink); }
  .solutions__tab:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

  @media (max-width: 767px) {
    .solutions__title { font-size: var(--text-l); }
    .solutions__intro { margin-top: 0; }
    .solutions__stage { aspect-ratio: 1; }
    .solutions__tabs { grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
    .solutions__tab { padding-right: 0; }
  }
</style>

<script>
(() => {
  const DWELL = 4000;
  const STAGE_SHARE = { wide: 0.52, narrow: 0.78 };
  const FILL_HEIGHT = 0.72;
  const still = matchMedia('(prefers-reduced-motion: reduce)');

  for (const root of document.querySelectorAll('.solutions')) {
    const stage = root.querySelector('.solutions__stage');
    const windowBox = root.querySelector('.solutions__window');
    const tabs = [...root.querySelectorAll('.solutions__tab')];
    const views = [...root.querySelectorAll('.solutions__view')];
    const track = root.querySelector('.solutions__track');
    const fill = root.querySelector('.solutions__fill');
    const places = [...root.querySelectorAll('.solutions__place')];
    let current = 0;
    let started = 0;
    let frame = 0;
    let visible = false;
    let spent = 0;

    const fit = () => {
      const natural = windowBox.offsetWidth;
      const share = stage.clientWidth < 600 ? STAGE_SHARE.narrow : STAGE_SHARE.wide;
      const room = stage.clientHeight * FILL_HEIGHT;
      const scale = Math.min((stage.clientWidth * share) / natural, room / windowBox.offsetHeight);
      windowBox.style.transform = `scale(${scale})`;
      windowBox.style.marginRight = `${natural * (scale - 1)}px`;
      windowBox.style.marginBottom = `${windowBox.offsetHeight * (scale - 1)}px`;
    };

    const show = (index) => {
      current = index;
      tabs.forEach((tab, i) => {
        tab.setAttribute('aria-selected', String(i === index));
        tab.tabIndex = i === index ? 0 : -1;
      });
      views.forEach((view, i) => view.classList.toggle('is-current', i === index));
      places.forEach((place, i) => place.classList.toggle('is-here', i === index));
      track.style.left = `${(100 / tabs.length) * index}%`;
      spent = 0;
      started = performance.now();
      fill.style.width = still.matches ? '100%' : '0%';
    };

    const tick = (now) => {
      const progress = Math.min((spent + now - started) / DWELL, 1);
      fill.style.width = `${progress * 100}%`;
      if (progress >= 1) show((current + 1) % tabs.length);
      frame = requestAnimationFrame(tick);
    };
    const sync = () => {
      cancelAnimationFrame(frame);
      frame = 0;
      if (visible && !still.matches) { started = performance.now(); frame = requestAnimationFrame(tick); }
    };
    const pause = () => { if (frame) spent += performance.now() - started; };

    tabs.forEach((tab, index) => {
      tab.addEventListener('click', () => { show(index); sync(); });
      tab.addEventListener('keydown', (event) => {
        const step = { ArrowRight: 1, ArrowLeft: -1 }[event.key];
        if (!step) return;
        event.preventDefault();
        const next = (index + step + tabs.length) % tabs.length;
        show(next);
        sync();
        tabs[next].focus();
      });
    });

    show(0);
    fit();
    new ResizeObserver(fit).observe(stage);
    new IntersectionObserver(([entry]) => {
      if (!entry.isIntersecting) pause();
      visible = entry.isIntersecting;
      sync();
    }).observe(stage);
  }
})();
</script>

Similar components

Theme flood

Theme flood

Two-part bar

Two-part bar

Keypad and knob

Keypad and knob

Instrument panel

Instrument panel

Film player

Film player

Question wheel

Question wheel

Flavour picker

Flavour picker

Film reel

Film reel