# Device status card

> A battery ring with an online dot, time left and two readings, and the ring breathes gently on hover.

- Category: [Cards](https://library.aimran.es/components/cards)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-card-device
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Built for companion apps and control panels: the battery of an e-bike, a smart speaker in a home automation dashboard, a portable power station or a pair of wireless headphones. The ring shows the charge, with the time left and two readings underneath, so the device status reads at a glance.

The 78% fill is set in the styles, so update it together with the number when you plug in real data. Switch the green dot to grey when the device goes offline; a ring that keeps breathing while nothing is connected is misleading.

## Code

### HTML

```html
<article class="uv-cdevice"><header><i></i><span>EN LÍNEA</span><button>•••</button></header><div class="ring"><b>78<small>%</small></b><i></i></div><h3>Studio One</h3><p>4 h 28 min restantes</p><footer><span>Temperature <b>32°</b></span><span>Power <b>18 W</b></span></footer></article>
```

### CSS

```css
.uv-cdevice {
  --c1: #0071e3;
  --c2: #8ec5ff;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uv-cdevice {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  width: 16em;
  padding: 1.4em;
  border-radius: 1.5em;
  font-size: var(--s);
  text-align: center;
  color: var(--fg);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 25px 60px -40px #000;
}

.uv-cdevice header {
  display: flex;
  align-items: center;
  text-align: left;
  font-size: .6em;
}

.uv-cdevice header>i {
  width: .55em;
  height: .55em;
  margin-right: .5em;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 .35em color-mix(in srgb,#30d158 15%,transparent);
}

.uv-cdevice header button {
  margin-left: auto;
  border: 0;
  color: var(--fg);
  background: transparent;
}

.uv-cdevice .ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 8em;
  height: 8em;
  margin: 1.4em auto;
  border-radius: 50%;
  background: conic-gradient(var(--c1) 0 78%,color-mix(in srgb,var(--fg) 8%,transparent) 78%);
  box-shadow: 0 0 35px color-mix(in srgb,var(--c1) 18%,transparent);
}

.uv-cdevice .ring::before {
  content: "";
  position: absolute;
  inset: .55em;
  border-radius: 50%;
  background: var(--bg);
}

.uv-cdevice .ring>b {
  position: relative;
  font-size: 1.8em;
  font-weight: 500;
}

.uv-cdevice .ring small {
  font-size: .45em;
}

.uv-cdevice .ring i {
  position: absolute;
  width: .65em;
  height: .65em;
  left: calc(50% - .325em);
  top: -.325em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px var(--c1);
  transform-origin: .325em 4.325em;
  transform: rotate(280deg);
}

.uv-cdevice h3 {
  margin: .2em 0;
}

.uv-cdevice p {
  margin: 0;
  font-size: .72em;
  opacity: .5;
}

.uv-cdevice footer {
  display: flex;
  margin-top: 1.2em;
  padding-top: 1em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 9%,transparent);
}

.uv-cdevice footer span {
  flex: 1;
  font-size: .62em;
  opacity: .5;
}

.uv-cdevice footer b {
  display: block;
  margin-top: .25em;
  font-size: 1.25em;
  color: var(--fg);
  opacity: 1;
}

.uv-cdevice:hover .ring {
  animation: uv-cd-p calc(1.4s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

@keyframes uv-cd-p {
  50% {
    transform: scale(1.035);
  }
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uv-cdevice {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  width: 16em;
  padding: 1.4em;
  border-radius: 1.5em;
  font-size: var(--s);
  text-align: center;
  color: var(--fg);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 25px 60px -40px #000;
}

.uv-cdevice header {
  display: flex;
  align-items: center;
  text-align: left;
  font-size: .6em;
}

.uv-cdevice header>i {
  width: .55em;
  height: .55em;
  margin-right: .5em;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 .35em color-mix(in srgb,#30d158 15%,transparent);
}

.uv-cdevice header button {
  margin-left: auto;
  border: 0;
  color: var(--fg);
  background: transparent;
}

.uv-cdevice .ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 8em;
  height: 8em;
  margin: 1.4em auto;
  border-radius: 50%;
  background: conic-gradient(var(--c1) 0 78%,color-mix(in srgb,var(--fg) 8%,transparent) 78%);
  box-shadow: 0 0 35px color-mix(in srgb,var(--c1) 18%,transparent);
}

.uv-cdevice .ring::before {
  content: "";
  position: absolute;
  inset: .55em;
  border-radius: 50%;
  background: var(--bg);
}

.uv-cdevice .ring>b {
  position: relative;
  font-size: 1.8em;
  font-weight: 500;
}

.uv-cdevice .ring small {
  font-size: .45em;
}

.uv-cdevice .ring i {
  position: absolute;
  width: .65em;
  height: .65em;
  left: calc(50% - .325em);
  top: -.325em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px var(--c1);
  transform-origin: .325em 4.325em;
  transform: rotate(280deg);
}

.uv-cdevice h3 {
  margin: .2em 0;
}

.uv-cdevice p {
  margin: 0;
  font-size: .72em;
  opacity: .5;
}

.uv-cdevice footer {
  display: flex;
  margin-top: 1.2em;
  padding-top: 1em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 9%,transparent);
}

.uv-cdevice footer span {
  flex: 1;
  font-size: .62em;
  opacity: .5;
}

.uv-cdevice footer b {
  display: block;
  margin-top: .25em;
  font-size: 1.25em;
  color: var(--fg);
  opacity: 1;
}

.uv-cdevice:hover .ring {
  animation: uv-cd-p calc(1.4s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

@keyframes uv-cd-p {
  50% {
    transform: scale(1.035);
  }
}
`;

export default function CardDevice() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uv-cdevice"><header><i></i><span>EN LÍNEA</span><button>•••</button></header><div className="ring"><b>78<small>%</small></b><i></i></div><h3>Studio One</h3><p>4 h 28 min restantes</p><footer><span>Temperature <b>32°</b></span><span>Power <b>18 W</b></span></footer></article>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Device status card” block (Cards) from AIMRAN Library to my project.

## What it is
A battery ring with an online dot, time left and two readings, and the ring breathes gently on hover.

## Chosen settings
- Main color: #0071e3
- Secondary color: #8ec5ff
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Studio One"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import type { CSSProperties } from "react";

const css = `
.uv-cdevice {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  width: 16em;
  padding: 1.4em;
  border-radius: 1.5em;
  font-size: var(--s);
  text-align: center;
  color: var(--fg);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 25px 60px -40px #000;
}

.uv-cdevice header {
  display: flex;
  align-items: center;
  text-align: left;
  font-size: .6em;
}

.uv-cdevice header>i {
  width: .55em;
  height: .55em;
  margin-right: .5em;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 .35em color-mix(in srgb,#30d158 15%,transparent);
}

.uv-cdevice header button {
  margin-left: auto;
  border: 0;
  color: var(--fg);
  background: transparent;
}

.uv-cdevice .ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 8em;
  height: 8em;
  margin: 1.4em auto;
  border-radius: 50%;
  background: conic-gradient(var(--c1) 0 78%,color-mix(in srgb,var(--fg) 8%,transparent) 78%);
  box-shadow: 0 0 35px color-mix(in srgb,var(--c1) 18%,transparent);
}

.uv-cdevice .ring::before {
  content: "";
  position: absolute;
  inset: .55em;
  border-radius: 50%;
  background: var(--bg);
}

.uv-cdevice .ring>b {
  position: relative;
  font-size: 1.8em;
  font-weight: 500;
}

.uv-cdevice .ring small {
  font-size: .45em;
}

.uv-cdevice .ring i {
  position: absolute;
  width: .65em;
  height: .65em;
  left: calc(50% - .325em);
  top: -.325em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px var(--c1);
  transform-origin: .325em 4.325em;
  transform: rotate(280deg);
}

.uv-cdevice h3 {
  margin: .2em 0;
}

.uv-cdevice p {
  margin: 0;
  font-size: .72em;
  opacity: .5;
}

.uv-cdevice footer {
  display: flex;
  margin-top: 1.2em;
  padding-top: 1em;
  border-top: 1px solid color-mix(in srgb,var(--fg) 9%,transparent);
}

.uv-cdevice footer span {
  flex: 1;
  font-size: .62em;
  opacity: .5;
}

.uv-cdevice footer b {
  display: block;
  margin-top: .25em;
  font-size: 1.25em;
  color: var(--fg);
  opacity: 1;
}

.uv-cdevice:hover .ring {
  animation: uv-cd-p calc(1.4s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

@keyframes uv-cd-p {
  50% {
    transform: scale(1.035);
  }
}
`;

export default function CardDevice() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uv-cdevice"><header><i></i><span>EN LÍNEA</span><button>•••</button></header><div className="ring"><b>78<small>%</small></b><i></i></div><h3>Studio One</h3><p>4 h 28 min restantes</p><footer><span>Temperature <b>32°</b></span><span>Power <b>18 W</b></span></footer></article>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
