{"id":37744,"date":"2017-08-28T21:01:46","date_gmt":"2017-08-28T13:01:46","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=37744"},"modified":"2022-07-22T19:53:17","modified_gmt":"2022-07-22T11:53:17","slug":"create-device-mockups-browser","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/","title":{"rendered":"Create Device Mockups in Browser with DeviceMock"},"content":{"rendered":"<p>You can find tons of <a href=\"https:\/\/www.hongkiat.com\/blog\/apple-devices-mockups-psd\/\">free device mockups<\/a> online, ranging from PSDs to Sketch files. But, what if you could quickly <strong>build device mockups on-the-fly<\/strong> in your browser?<\/p>\n<p>Well, thanks to the folks at rm-labo, you can! Their free jQuery plugin, <a href=\"https:\/\/github.com\/rm-labo\/devicemock\" rel=\"nofollow noopener\" target=\"_blank\">DeviceMock.js<\/a>, lets you <strong>wrap a vector device around any page element<\/strong>, using simple JavaScript and <a href=\"https:\/\/www.hongkiat.com\/blog\/scalable-vector-graphic\/\">SVGs<\/a>.<\/p>\n<p>So, how exactly does this work?<\/p>\n<p>Well, first you need <strong>a copy of jQuery<\/strong> and <strong>a version of the DeviceMock plugin <a href=\"https:\/\/github.com\/rm-labo\/devicemock\" rel=\"nofollow noopener\" target=\"_blank\">from GitHub<\/a><\/strong>. This comes with a JS file, CSS file, and some SVG files to create the actual devices.<\/p>\n<p>You can <strong>target any type of element<\/strong> on the page, from a simple image to an entire div, or even an embedded element such as an iframe. This means you could even <strong>build a cool mini-browser<\/strong> right in your site with an iframe to another page.<\/p>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/sketch-viewer\/\" rel=\"noopener\">View & Share Your Sketch Mockups Online with Sketch Viewer<\/a><\/p>\n<p>This plugin supports <strong>five different device types<\/strong>:<\/p>\n<ol>\n<li>Web browser<\/li>\n<li>Smartphone<\/li>\n<li>Tablet<\/li>\n<li>Desktop<\/li>\n<li>Laptop<\/li>\n<\/ol>\n<p>All of these mockups use <strong><a href=\"https:\/\/www.hongkiat.com\/blog\/flat-design-resources\/\">flat design styles<\/a><\/strong> since they\u2019re built with SVGs. And, they all look quite similar to Apple devices, for instance the smartphone being a clone of the iPhone and the desktop monitor looking conspicuously like an iMac.<\/p>\n<p>All of these vectors are easy to add and they work in <strong>every browser with SVG support<\/strong>.<\/p>\n<p>You can even <strong>change properties<\/strong> such as the mockup size, theme (white\/black) and orientation (portrait landscape).<\/p>\n<p>If you use the browser mockup you can even <strong>specify a dummy URL<\/strong> in the address bar. This is a fun way to add even more customization.<\/p>\n<figure><a href=\"http:\/\/rm-labo.com\/labo\/devicemock\/\" rel=\"nofollow noopener\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/create-device-mockups-browser\/02-tablet-device-mockup-script.jpg\" alt=\"Tablet mockup JS preview\" width=\"1000\" height=\"554\"><\/a><\/figure>\n<p>Granted this library won\u2019t be useful for everyone but it <strong>does solve a niche problem<\/strong> that many UI\/UX developers face when prototyping.<\/p>\n<p>To learn more, visit the <strong><a href=\"https:\/\/github.com\/rm-labo\/devicemock\" rel=\"nofollow noopener\" target=\"_blank\">GitHub page<\/a><\/strong> or check out the <strong><a href=\"http:\/\/rm-labo.com\/labo\/devicemock\/\" rel=\"nofollow noopener\" target=\"_blank\">live site<\/a><\/strong> for an active demo.<\/p>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/creative-free-magazine-templates\/\" rel=\"noopener\">40 Creative Magazine PSD Mockups to Download<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>You can find tons of free device mockups online, ranging from PSDs to Sketch files. But, what if you could quickly build device mockups on-the-fly in your browser? Well, thanks to the folks at rm-labo, you can! Their free jQuery plugin, DeviceMock.js, lets you wrap a vector device around any page element, using simple JavaScript&hellip;<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3395],"tags":[4102],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Create Device Mockups in Browser with DeviceMock - Hongkiat<\/title>\n<meta name=\"description\" content=\"You can find tons of free device mockups online, ranging from PSDs to Sketch files. But, what if you could quickly build device mockups on-the-fly in your\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Device Mockups in Browser with DeviceMock\" \/>\n<meta property=\"og:description\" content=\"You can find tons of free device mockups online, ranging from PSDs to Sketch files. But, what if you could quickly build device mockups on-the-fly in your\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-28T13:01:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-22T11:53:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/create-device-mockups-browser\/02-tablet-device-mockup-script.jpg\" \/>\n<meta name=\"author\" content=\"Jake Rocheleau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jake Rocheleau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/\"},\"author\":{\"name\":\"Jake Rocheleau\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\"},\"headline\":\"Create Device Mockups in Browser with DeviceMock\",\"datePublished\":\"2017-08-28T13:01:46+00:00\",\"dateModified\":\"2022-07-22T11:53:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/\"},\"wordCount\":328,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/create-device-mockups-browser\\\/02-tablet-device-mockup-script.jpg\",\"keywords\":[\"Interface Design\"],\"articleSection\":[\"UI\\\/UX\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/\",\"name\":\"Create Device Mockups in Browser with DeviceMock - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/create-device-mockups-browser\\\/02-tablet-device-mockup-script.jpg\",\"datePublished\":\"2017-08-28T13:01:46+00:00\",\"dateModified\":\"2022-07-22T11:53:17+00:00\",\"description\":\"You can find tons of free device mockups online, ranging from PSDs to Sketch files. But, what if you could quickly build device mockups on-the-fly in your\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/create-device-mockups-browser\\\/02-tablet-device-mockup-script.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/create-device-mockups-browser\\\/02-tablet-device-mockup-script.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/create-device-mockups-browser\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Device Mockups in Browser with DeviceMock\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\",\"name\":\"Jake Rocheleau\",\"description\":\"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers\",\"sameAs\":[\"https:\\\/\\\/www.hongkiat.com\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/jake\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Create Device Mockups in Browser with DeviceMock - Hongkiat","description":"You can find tons of free device mockups online, ranging from PSDs to Sketch files. But, what if you could quickly build device mockups on-the-fly in your","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/","og_locale":"en_US","og_type":"article","og_title":"Create Device Mockups in Browser with DeviceMock","og_description":"You can find tons of free device mockups online, ranging from PSDs to Sketch files. But, what if you could quickly build device mockups on-the-fly in your","og_url":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2017-08-28T13:01:46+00:00","article_modified_time":"2022-07-22T11:53:17+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/create-device-mockups-browser\/02-tablet-device-mockup-script.jpg","type":"","width":"","height":""}],"author":"Jake Rocheleau","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Jake Rocheleau","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/"},"author":{"name":"Jake Rocheleau","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a"},"headline":"Create Device Mockups in Browser with DeviceMock","datePublished":"2017-08-28T13:01:46+00:00","dateModified":"2022-07-22T11:53:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/"},"wordCount":328,"commentCount":0,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/create-device-mockups-browser\/02-tablet-device-mockup-script.jpg","keywords":["Interface Design"],"articleSection":["UI\/UX"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/","url":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/","name":"Create Device Mockups in Browser with DeviceMock - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/create-device-mockups-browser\/02-tablet-device-mockup-script.jpg","datePublished":"2017-08-28T13:01:46+00:00","dateModified":"2022-07-22T11:53:17+00:00","description":"You can find tons of free device mockups online, ranging from PSDs to Sketch files. But, what if you could quickly build device mockups on-the-fly in your","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/create-device-mockups-browser\/02-tablet-device-mockup-script.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/create-device-mockups-browser\/02-tablet-device-mockup-script.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/create-device-mockups-browser\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create Device Mockups in Browser with DeviceMock"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a","name":"Jake Rocheleau","description":"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers","sameAs":["https:\/\/www.hongkiat.com"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/jake\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-9OM","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/37744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=37744"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/37744\/revisions"}],"predecessor-version":[{"id":60628,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/37744\/revisions\/60628"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=37744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=37744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=37744"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=37744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}