Battery Indicator
A copy-paste indicators component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
IndicatorsHTMLCSSany framework
68%
Copy into your project
HTML
<div class="nuda-batt">
<span class="nuda-batt__case">
<span class="nuda-batt__fill" style="width:68%"></span>
</span>
<span class="nuda-batt__cap"></span>
<span class="nuda-batt__pct">68%</span>
</div>CSS
.nuda-batt {
display: inline-flex;
align-items: center;
gap: 6px;
color: #fafafa;
font-size: 11px;
font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
font-variant-numeric: tabular-nums;
}
.nuda-batt__case {
position: relative;
width: 32px;
height: 14px;
border: 1.5px solid rgba(255,255,255,.4);
border-radius: 3px;
padding: 1.5px;
}
.nuda-batt__fill {
display: block;
height: 100%;
background: #6ee7b7;
border-radius: 1px;
transition: width .5s,background .35s;
}
.nuda-batt__cap {
width: 2px;
height: 6px;
background: rgba(255,255,255,.4);
border-radius: 0 1px 1px 0;
margin-left: -1px;
}
How to use Battery Indicator
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.