https://discord.gg/botpress logo
Customize size of chatbot on Mobile
# 🤝help
a
Is there a quick way to modify the size of the chatbot on mobile? a lot of users had a feedback that they did not like how it looks on mobile and difficult to Close. I tried changing the size using media via css and even adding !important. However without luck, still unable to change the size.
o
You can modify the width and height parameters of the webchat.
Copy code
html
<div id="webchat-container" style="position: relative; width: 100%; height: 100%;">
  <script src="https://cdn.botpress.cloud/webchat/v2.3/inject.js"></script>
  <script>
    window.botpress.on("webchat:ready", () => {
      window.botpress.open();
    });

    window.botpress.init({
      "botId": "YOUR_BOT_ID",
      "configuration": {
      },
      "clientId": "YOUR_CLIENT_ID"
    });
  </script>
  <style>
    .bpWebchat {
      width: 320px !important; /* Controls the width of the chat window */
      height: 450px !important; /* Controls the height of the chat window */
    }
    }
  </style>
</div>
You can place @media (max-width: 767px) above it to detect if on mobile
that should work. Adjust the width / height of .bpWebchat class as you'd like to make it readable / usable on mobile devices
a
Hi @orange-egg-72655 , I will check and get back if I run into any issues. Thank you so much and appreciate the help