Skip to content
Español

Navigate

Type to search. Press Escape to close.

    Components · css New in 1.1

    Mockup

    Device frames for marketing pages and documentation: a browser window with its three controls and an address bar, and a phone with rounded glass and a camera island. The frame is drawn entirely by the stylesheet — no frame images to download, scale or recolour — and what goes on the screen is yours: a screenshot, a video, or live markup built with iVOLT, as in the example below.

    CSS: css/components/mockup.css (in ivolt.css). JS: none. New in 1.1.

    Browser window and phone, with live contentfixtures/mockup/basic.htmlOpen alone — Browser window and phone, with live content
    <div class="iv-grid iv-u-gap-8 iv-u-grid-cols-1 iv-u-lg-grid-cols-3 iv-u-items-center">
      <figure class="iv-mockup iv-mockup--browser" style="grid-column: span 2; --iv-mockup-ratio: 2 / 1">
        <div class="iv-mockup__bar" aria-hidden="true"><span class="iv-mockup__url">app.example.com/dashboard</span></div>
        <div class="iv-mockup__screen iv-texture-mesh">
          <div class="iv-stack iv-u-gap-4 iv-u-p-6">
            <div class="iv-cluster iv-u-justify-between iv-u-items-center">
              <strong>Overview</strong>
              <span class="iv-badge iv-badge--success">Live</span>
            </div>
            <div class="iv-grid iv-u-gap-3 iv-u-grid-cols-3">
              <div class="iv-card"><div class="iv-card__body"><div class="iv-u-text-sm iv-u-text-muted">Visitors</div><strong class="iv-u-text-xl">12.4k</strong></div></div>
              <div class="iv-card"><div class="iv-card__body"><div class="iv-u-text-sm iv-u-text-muted">Builds</div><strong class="iv-u-text-xl">318</strong></div></div>
              <div class="iv-card"><div class="iv-card__body"><div class="iv-u-text-sm iv-u-text-muted">Uptime</div><strong class="iv-u-text-xl">99.98 %</strong></div></div>
            </div>
            <progress class="iv-progress" value="72" max="100" aria-label="Sample progress, 72 percent"></progress>
          </div>
        </div>
      </figure>
    
      <figure class="iv-mockup iv-mockup--phone">
        <div class="iv-mockup__screen">
          <div class="iv-stack iv-u-gap-3 iv-u-p-5" style="padding-block-start: 3.25rem">
            <strong class="iv-u-text-lg">Inbox</strong>
            <ul class="iv-list iv-list--flush" aria-label="Messages (sample)">
              <li class="iv-list__item"><span class="iv-list__body"><span class="iv-list__title">Deploy finished</span><span class="iv-list__meta">main · 2 min</span></span></li>
              <li class="iv-list__item"><span class="iv-list__body"><span class="iv-list__title">New comment</span><span class="iv-list__meta">Pricing page</span></span></li>
              <li class="iv-list__item"><span class="iv-list__body"><span class="iv-list__title">Invoice ready</span><span class="iv-list__meta">March</span></span></li>
            </ul>
          </div>
        </div>
      </figure>
    
      <p class="iv-u-m-0 iv-u-text-sm iv-u-text-muted" style="grid-column: 1 / -1">Both frames hold live markup built with iVOLT and made-up figures; a screenshot (<code>&lt;img&gt;</code>) works the same way.</p>
    </div>
    .iv-root {
      --iv-mockup-ratio: 2 / 1;
    }

    When to use it

    Use a mockup when the reader needs to recognise “this is the product”: a hero that shows the dashboard, a feature section that shows the mobile app, a changelog entry that shows the new screen. Inside documentation, a browser frame around a screenshot tells the reader the picture is a page and not a diagram. Do not frame everything; a page with six mockups reads like a slide deck.

    Anatomy and variants

    <figure class="iv-mockup iv-mockup--browser">
      <div class="iv-mockup__bar" aria-hidden="true">
        <span class="iv-mockup__url">app.example.com</span>
      </div>
      <div class="iv-mockup__screen"><img src="dashboard.avif" alt="…"></div>
    </figure>
    
    <figure class="iv-mockup iv-mockup--phone">
      <div class="iv-mockup__screen">…</div>
    </figure>
    • iv-mockup--browser: a window at 16:10 by default. The address in __url is decoration, so write a believable but fictional host.
    • iv-mockup--phone: a handset at 9:19.5, 18rem wide. Leave some room at the top of the screen for the island (the example pads its content by 3.25rem).
    • iv-mockup--tilt: a slight perspective for a hero, which flattens a little under the pointer and is removed entirely under reduced motion.

    The window controls and the island are pseudo-elements, never announced. In a right-to-left page they mirror.

    Accessibility

    • The figure is the content, the frame is not. Give the image on the screen a real alt, or, for live markup, make sure it makes sense when read — the example uses sample figures and says so.
    • Mark the bar aria-hidden="true"; a screen reader has no use for a fake address.
    • Live markup inside a mockup is still live: links and buttons there are focusable. If the content is only a picture of an interface, make it an image or set inert on the screen.
    • Add a <figcaption> when the screen needs explaining.
    • In forced colours the frame becomes a plain outline and the decorative controls are hidden.

    Customising

    .hero .iv-mockup {
      --iv-mockup-ratio: 2 / 1;
      --iv-mockup-frame: var(--iv-color-surface);
    }
    .hero .iv-mockup--phone { --iv-mockup-width: 16rem; }

    Locals: --iv-mockup-frame (the colour of the frame, mixed from the raised surface and the text so it separates from both themes), --iv-mockup-ratio (the aspect ratio of the screen) and --iv-mockup-width (the width of the phone).

    Common mistakes

    • A real customer's domain in the address bar.
    • A screenshot without alt because “it is only a mockup”.
    • Interactive demo content inside a tilted frame, where hit-testing follows the perspective and feels off.
    • Squeezing a desktop screenshot into the phone frame.

    Class index

    Every class of the family. The full list per stylesheet lives in the reference.

    ClassWhat it does
    iv-mockupThe frame, on a <figure>.
    iv-mockup--browserBrowser window.
    iv-mockup--phonePhone.
    iv-mockup--tiltPerspective tilt for a hero.
    iv-mockup__bar · iv-mockup__urlWindow bar and address (decorative).
    iv-mockup__screenWhere the content goes.