How To Use Phone Mockup Component In Vue.js

In this article, I will guide you on how to use Phone mockup component in Vue.js application.


  • node.js installed
  • Tailwind CSS

You can check how to install Tailwind CSS  in vue.js from the below link

Create Vue.js Project

To create a Vue.js app, use the following command in the terminal.

vue create tailwindcss

Install daisyUI

Install daisyUI using following npm command

npm i daisyui

Open tailwind.config.js and add following code.

module.exports = {
  content: [
  theme: {
    extend: {},
  plugins: [require("daisyui")],

Now right-click on the components folder and add a new component named 'phonemockupdemo.vue'. Now open phonemockupdemo.vue component and add the following code. 

        <div class="mockup-phone">
            <div class="camera"></div>
            <div class="display">
                <div class="artboard artboard-demo phone-1">Hi...</div>
export default {
    name: 'phonemockupdemo',
    props: {
        msg: String
<style scoped>
h3 {
    margin: 40px 0 0;

ul {
    list-style-type: none;
    padding: 0;

li {
    display: inline-block;
    margin: 0 10px;

a {
    color: #42b983;

Now open App.vue component. Add the following code in App.vue component.

  <div id="app">

import phonemockupdemo from './components/phonemockupdemo.vue'

export default {
  name: 'App',
  components: {

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;

Now run the application by using following command.

npm run serve

We also add color, add the following code in phonemockupdemo.vue component.


 In this article, we learned how to use Phone mockup component in Vue.js.

Similar Articles