# Mockup browser

> A mockup browser is a frame that looks like a browser window, with the window dots and an address bar, to show a page preview or a screenshot.

Show a screenshot or any content inside a browser window frame with the mockup browser component. Add an address, a lock icon or your own colors.

Source: https://docs.tabler.io/ui/components/mockup-browser

---

## Default markup

A `.mockup-browser` has a `.mockup-browser-toolbar` with the window dots and an address bar, and a `.mockup-browser-body` with the page. An image in the body fills the width of the frame.

```html
<div class="mockup-browser">
  <div class="mockup-browser-toolbar">
    <span class="mockup-browser-controls"></span>
    <div class="mockup-browser-url">
      <span>preview.tabler.io</span>
    </div>
  </div>
  <div class="mockup-browser-body">
    <img src="/static/tabler-preview.png" srcset="/static/tabler-preview.png 1x, /static/tabler-preview@2x.png 2x" class="hide-theme-dark" alt="Tabler dashboard" />
    <img src="/static/tabler-preview-dark.png" srcset="/static/tabler-preview-dark.png 1x, /static/tabler-preview-dark@2x.png 2x" class="hide-theme-light" alt="Tabler dashboard" />
  </div>
</div>
```

## Secure address

Put an icon before the address text to show a secure page. The icon is scaled down to match the text.

```html
<div class="mockup-browser">
  <div class="mockup-browser-toolbar">
    <span class="mockup-browser-controls"></span>
    <div class="mockup-browser-url">
      <!-- Download SVG icon from http://tabler.io/icons/icon/lock -->
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon">
        <path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6" />
        <path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
        <path d="M8 11v-4a4 4 0 1 1 8 0v4" />
      </svg>
      <span>
        <a href="https://preview.tabler.io">https://preview.tabler.io</a>
      </span>
    </div>
  </div>
  <div class="mockup-browser-body">
    <img src="/static/tabler-preview.png" srcset="/static/tabler-preview.png 1x, /static/tabler-preview@2x.png 2x" class="hide-theme-dark" alt="Tabler dashboard" />
    <img src="/static/tabler-preview-dark.png" srcset="/static/tabler-preview-dark.png 1x, /static/tabler-preview-dark@2x.png 2x" class="hide-theme-light" alt="Tabler dashboard" />
  </div>
</div>
```

## Without an address bar

Leave out `.mockup-browser-url` for a plain window frame with only the dots.

```html
<div class="mockup-browser">
  <div class="mockup-browser-toolbar">
    <span class="mockup-browser-controls"></span>
  </div>
  <div class="mockup-browser-body">
    <img src="/static/tabler-preview.png" srcset="/static/tabler-preview.png 1x, /static/tabler-preview@2x.png 2x" class="hide-theme-dark" alt="Tabler dashboard" />
    <img src="/static/tabler-preview-dark.png" srcset="/static/tabler-preview-dark.png 1x, /static/tabler-preview-dark@2x.png 2x" class="hide-theme-light" alt="Tabler dashboard" />
  </div>
</div>
```

## Sizes

Add `.mockup-browser-sm` for a 24px toolbar with smaller dots and text. Use it for thumbnails and for frames inside cards.

```html
<div class="row g-3 align-items-start">
  <div class="col-md-7">
    <div class="mockup-browser">
      <div class="mockup-browser-toolbar">
        <span class="mockup-browser-controls"></span>
        <div class="mockup-browser-url">
          <!-- Download SVG icon from http://tabler.io/icons/icon/lock -->
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon">
            <path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6" />
            <path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
            <path d="M8 11v-4a4 4 0 1 1 8 0v4" />
          </svg>
          <span>preview.tabler.io</span>
        </div>
      </div>
      <div class="mockup-browser-body">
        <img src="/static/tabler-preview.png" srcset="/static/tabler-preview.png 1x, /static/tabler-preview@2x.png 2x" class="hide-theme-dark" alt="Tabler dashboard" />
        <img src="/static/tabler-preview-dark.png" srcset="/static/tabler-preview-dark.png 1x, /static/tabler-preview-dark@2x.png 2x" class="hide-theme-light" alt="Tabler dashboard" />
      </div>
    </div>
  </div>
  <div class="col-md-5">
    <div class="mockup-browser mockup-browser-sm">
      <div class="mockup-browser-toolbar">
        <span class="mockup-browser-controls"></span>
        <div class="mockup-browser-url">
          <!-- Download SVG icon from http://tabler.io/icons/icon/lock -->
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon">
            <path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6" />
            <path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
            <path d="M8 11v-4a4 4 0 1 1 8 0v4" />
          </svg>
          <span>preview.tabler.io</span>
        </div>
      </div>
      <div class="mockup-browser-body">
        <img src="/static/tabler-preview.png" srcset="/static/tabler-preview.png 1x, /static/tabler-preview@2x.png 2x" class="hide-theme-dark" alt="Tabler dashboard" />
        <img src="/static/tabler-preview-dark.png" srcset="/static/tabler-preview-dark.png 1x, /static/tabler-preview-dark@2x.png 2x" class="hide-theme-light" alt="Tabler dashboard" />
      </div>
    </div>
  </div>
</div>
```

## Any content

The body takes any markup, not only an image. Add a padding utility to the body when the content needs space from the frame.

```html
<div class="mockup-browser">
  <div class="mockup-browser-toolbar">
    <span class="mockup-browser-controls"></span>
    <div class="mockup-browser-url">
      <!-- Download SVG icon from http://tabler.io/icons/icon/lock -->
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon">
        <path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6" />
        <path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
        <path d="M8 11v-4a4 4 0 1 1 8 0v4" />
      </svg>
      <span>example.com/signup</span>
    </div>
  </div>
  <div class="mockup-browser-body p-4">
    <h3 class="card-title">Create an account</h3>
    <div class="mb-3">
      <label class="form-label" for="mockup-browser-email">Email</label>
      <input type="email" class="form-control" id="mockup-browser-email" placeholder="you@example.com" />
    </div>
    <button type="button" class="btn btn-primary w-100">Sign up</button>
  </div>
</div>
```

## Custom look

Set the `--tblr-mockup-browser-*` variables on the frame to change the colors, the shadow or the size of the dots. The three dots have their own color variables, `--tblr-mockup-browser-control-color-1` to `-3`.

```html
<div class="mockup-browser" style="--tblr-mockup-browser-toolbar-bg: var(--tblr-gray-900); --tblr-mockup-browser-toolbar-color: var(--tblr-gray-400); --tblr-mockup-browser-border-color: var(--tblr-gray-900); --tblr-mockup-browser-box-shadow: none">
  <div class="mockup-browser-toolbar">
    <span class="mockup-browser-controls"></span>
    <div class="mockup-browser-url">
      <!-- Download SVG icon from http://tabler.io/icons/icon/lock -->
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon">
        <path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6" />
        <path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
        <path d="M8 11v-4a4 4 0 1 1 8 0v4" />
      </svg>
      <span>preview.tabler.io</span>
    </div>
  </div>
  <div class="mockup-browser-body">
    <img src="/static/tabler-preview-dark.png" srcset="/static/tabler-preview-dark.png 1x, /static/tabler-preview-dark@2x.png 2x" alt="Tabler dashboard" />
  </div>
</div>
```

## Accessibility

- The window dots are decoration. They are an empty element, so screen readers skip them.
- The address bar is plain text and is read as such. It is not a link and not a form field.
- Give a screenshot in the body an `alt` text that says what page it shows.
