Add a "Made with Replit" badge to your Webview
You can add a "Made with Replit" badge in your public Repl's webview. It will link back to your Repl's cover page so that visitors can learn more about your creations.
What is the Webview?
The webview is the view of your repl that visitors to your Repl see when they click "Open website."
The webview appears full-screen in its own browser window, and has the following URL format:
https://{your-repl-name}.{your-user-name}.repl.co/
(Or at your custom domain if you've set one up)
Adding the Badge
The badge can be added to any repl with an index page serving HTML. Any website created with the official HTML template will have this badge added by default.
Go to your Repl's file browser and find
index.html
Add the following code before the closing
</body>
tag:
<script
src="https://replit.com/public/js/replit-badge-v2.js"
theme="dark"
position="bottom-right"
></script>
Testing your Badge
Run your Repl, then click "Open in a new tab"
Your badge should appear in the lower right. This is what visitors to your page would see
Click your badge to get back to the Repl's cover page
Changing the Color Theme
You can change the color of your badge by replacing theme="blue"
with any color including dark, light, red, orange, yellow, lime, green, teal, blue, blurple, purple, magenta and pink.
<script
src="https://replit.com/public/js/replit-badge-v2.js"
theme="pink"
position="bottom-right"
></script>
Changing the Position
You can change the position of your badge by adding a position attribute with a value of top-left
, top-right
, bottom-left
, or bottom-right
. If the position isn't changing, check the console for more information - you may have specified an invalid position!
<script
src="https://replit.com/public/js/replit-badge-v2.js"
theme="dark"
position="top-left"
></script>
How to Remove the Badge
If the badge was already a part of your template and you would like to remove it, simply delete the script from index.html
:
<!-- Delete this -->
<script src="https://replit.com/public/js/replit-badge-v2.js"></script>
Advanced: Custom Badges
If the default configurations aren't enough for you, you can create your own custom badge script!
Badges are hosted on https://replit.com/badge?theme=light
, meaning you can just embed an image to further style your badges with CSS. This also means you can embed badges in your GitHub repositories and other Markdown files!
<style>
#replitBadge {
position: fixed;
bottom: 0;
left: 0;
}
</style>
<img src="https://replit.com/badge?theme=light" id="replitBadge" />
Please let us know in the community what you think of this feature. Repl on!