To use Mica-Web, you must include the mica.js script in your HTML file like this :
<script src="./mica.js"></script>
After adding script, add a class in your element to apply the mica effect.
Exemple:
<div class="mica draggable border">
<h1>Hello World</h1>
<p>Mica-Web By GregVido</p>
</div>
The mica
keyword applies the mica effect, draggable
activates window displacement, and border
applies windows 11 border to the element.
You can replace the keyword mica
with acrylic
to have an acrylic background.
Default, the theme is light, but if you want to force dark theme, add theme-dark
to body like this :
<body class="theme-dark" data-mica-url="./wallpaper.jpg">
The data-mica-url
attribute is very important.
You can see exemple here.