# Minute-by-minute rain toast

> Warns that rain is coming with a minute-by-minute bar chart that grows in as it appears and an alert you can switch on.

- Category: [Toasts](https://library.aimran.es/components/toasts)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-toast-rain-radar
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Weather apps made the next hour rain chart familiar, and it explains a forecast faster than words. This toast pairs a cloud with falling drops, a short summary and 24 bars that rise one after another with staggered CSS transitions. A bell toggle with aria-pressed lets people ask for a reminder. Good for weather services, outdoor event tools and delivery planning.

The main color fills the bars and icon; the second marks the minutes without rain. Swap the data array for real values from your API, and change the axis labels if you show a different time window.

## Code

### HTML

```html
<div class="uvq09-rdr"><button type="button" class="fire">Show again</button><div class="tt" role="status"><div class="hd"><span class="ic" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 15.5a4.5 4.5 0 0 1-.4-9A6 6 0 0 1 18 8a3.8 3.8 0 0 1-.5 7.5z"/></svg><i></i><i></i><i></i></span><span class="tx"><b>Rain in 15 minutes</b><small>Moderate from 18:15 to 18:40</small></span><button type="button" class="bl" aria-pressed="false" aria-label="Notify me when it starts"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 2h-15z"/><path d="M10 20.5a2 2 0 0 0 4 0"/></svg></button></div><div class="ch" aria-hidden="true"><i class="z" style="--h:4%;--i:0"></i><i class="z" style="--h:4%;--i:1"></i><i class="z" style="--h:4%;--i:2"></i><i class="z" style="--h:4%;--i:3"></i><i class="z" style="--h:4%;--i:4"></i><i class="z" style="--h:4%;--i:5"></i><i style="--h:12%;--i:6"></i><i style="--h:24%;--i:7"></i><i style="--h:40%;--i:8"></i><i style="--h:58%;--i:9"></i><i style="--h:74%;--i:10"></i><i style="--h:88%;--i:11"></i><i style="--h:95%;--i:12"></i><i style="--h:84%;--i:13"></i><i style="--h:66%;--i:14"></i><i style="--h:52%;--i:15"></i><i style="--h:44%;--i:16"></i><i style="--h:36%;--i:17"></i><i style="--h:26%;--i:18"></i><i style="--h:18%;--i:19"></i><i style="--h:11%;--i:20"></i><i style="--h:6%;--i:21"></i><i class="z" style="--h:4%;--i:22"></i><i class="z" style="--h:4%;--i:23"></i></div><div class="ax" aria-hidden="true"><span>Now</span><span>30 min</span><span>60 min</span></div></div></div>
```

### CSS

```css
.uvq09-rdr {
  --c1: #0e7490;
  --c2: #94a3b8;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq09-rdr {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 21em;
  height: 15em;
}

.uvq09-rdr .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-rdr .fire:active {
  scale: .96;
}

.uvq09-rdr .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-rdr .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  padding: .85em .95em .75em;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-rdr .hd {
  display: flex;
  align-items: center;
  gap: .7em;
}

.uvq09-rdr .ic {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: .8em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 14%,transparent);
  overflow: hidden;
}

.uvq09-rdr .ic svg {
  width: 1.45em;
  height: 1.45em;
  margin-top: -.4em;
}

.uvq09-rdr .ic i {
  position: absolute;
  top: 1.5em;
  left: .8em;
  width: .11em;
  height: .42em;
  border-radius: 1em;
  background: var(--c1);
  opacity: 0;
  animation: uvq09-rdr-d calc(0.8s / var(--k)) linear infinite;
}

.uvq09-rdr .ic i:nth-of-type(2) {
  left: 1.15em;
  animation-delay: calc(0.27s / var(--k));
}

.uvq09-rdr .ic i:nth-of-type(3) {
  left: 1.5em;
  animation-delay: calc(0.54s / var(--k));
}

.uvq09-rdr .tx {
  display: grid;
  flex: 1;
  gap: .1em;
}

.uvq09-rdr .tx b {
  font-size: .95em;
}

.uvq09-rdr .tx small {
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-rdr .bl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .bl svg {
  width: 1.1em;
  height: 1.1em;
  transform-origin: 50% 15%;
}

.uvq09-rdr .bl:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 11%,transparent);
}

.uvq09-rdr .bl:active {
  scale: .92;
}

.uvq09-rdr .bl:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-rdr .bl[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
}

.uvq09-rdr .bl[aria-pressed="true"] svg {
  animation: uvq09-rdr-r calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .ch {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 3.2em;
  margin-top: .75em;
  border-bottom: 1px solid color-mix(in srgb,var(--fg) 15%,transparent);
}

.uvq09-rdr .ch::before {
  content: "";
  position: absolute;
  left: 0;
  top: -.3em;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--fg);
}

.uvq09-rdr .ch i {
  flex: 1;
  height: var(--h);
  border-radius: .15em .15em 0 0;
  background: linear-gradient(var(--c1),color-mix(in srgb,var(--c1) 45%,transparent));
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1) calc((.3s + var(--i) * .03s) / var(--k));
}

.uvq09-rdr .ch i.z {
  background: color-mix(in srgb,var(--c2) 40%,transparent);
}

.uvq09-rdr .tt.in .ch i {
  transform: none;
}

.uvq09-rdr .ax {
  display: flex;
  justify-content: space-between;
  margin-top: .3em;
  font-size: .62em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

@keyframes uvq09-rdr-d {
  0% {
    transform: translateY(-.2em);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(.7em);
    opacity: 0;
  }
}

@keyframes uvq09-rdr-r {
  20% {
    rotate: 18deg;
  }
  40% {
    rotate: -14deg;
  }
  60% {
    rotate: 8deg;
  }
  80% {
    rotate: -4deg;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-rdr,.uvq09-rdr *,.uvq09-rdr *::before,.uvq09-rdr *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq09-rdr").forEach(el => {
  const t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");b.setAttribute('aria-pressed','false')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const b=t.querySelector(".bl");b.addEventListener("click",()=>b.setAttribute("aria-pressed",b.getAttribute("aria-pressed")==="true"?"false":"true"));return clr
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq09-rdr {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 21em;
  height: 15em;
}

.uvq09-rdr .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-rdr .fire:active {
  scale: .96;
}

.uvq09-rdr .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-rdr .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  padding: .85em .95em .75em;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-rdr .hd {
  display: flex;
  align-items: center;
  gap: .7em;
}

.uvq09-rdr .ic {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: .8em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 14%,transparent);
  overflow: hidden;
}

.uvq09-rdr .ic svg {
  width: 1.45em;
  height: 1.45em;
  margin-top: -.4em;
}

.uvq09-rdr .ic i {
  position: absolute;
  top: 1.5em;
  left: .8em;
  width: .11em;
  height: .42em;
  border-radius: 1em;
  background: var(--c1);
  opacity: 0;
  animation: uvq09-rdr-d calc(0.8s / var(--k)) linear infinite;
}

.uvq09-rdr .ic i:nth-of-type(2) {
  left: 1.15em;
  animation-delay: calc(0.27s / var(--k));
}

.uvq09-rdr .ic i:nth-of-type(3) {
  left: 1.5em;
  animation-delay: calc(0.54s / var(--k));
}

.uvq09-rdr .tx {
  display: grid;
  flex: 1;
  gap: .1em;
}

.uvq09-rdr .tx b {
  font-size: .95em;
}

.uvq09-rdr .tx small {
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-rdr .bl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .bl svg {
  width: 1.1em;
  height: 1.1em;
  transform-origin: 50% 15%;
}

.uvq09-rdr .bl:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 11%,transparent);
}

.uvq09-rdr .bl:active {
  scale: .92;
}

.uvq09-rdr .bl:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-rdr .bl[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
}

.uvq09-rdr .bl[aria-pressed="true"] svg {
  animation: uvq09-rdr-r calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .ch {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 3.2em;
  margin-top: .75em;
  border-bottom: 1px solid color-mix(in srgb,var(--fg) 15%,transparent);
}

.uvq09-rdr .ch::before {
  content: "";
  position: absolute;
  left: 0;
  top: -.3em;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--fg);
}

.uvq09-rdr .ch i {
  flex: 1;
  height: var(--h);
  border-radius: .15em .15em 0 0;
  background: linear-gradient(var(--c1),color-mix(in srgb,var(--c1) 45%,transparent));
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1) calc((.3s + var(--i) * .03s) / var(--k));
}

.uvq09-rdr .ch i.z {
  background: color-mix(in srgb,var(--c2) 40%,transparent);
}

.uvq09-rdr .tt.in .ch i {
  transform: none;
}

.uvq09-rdr .ax {
  display: flex;
  justify-content: space-between;
  margin-top: .3em;
  font-size: .62em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

@keyframes uvq09-rdr-d {
  0% {
    transform: translateY(-.2em);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(.7em);
    opacity: 0;
  }
}

@keyframes uvq09-rdr-r {
  20% {
    rotate: 18deg;
  }
  40% {
    rotate: -14deg;
  }
  60% {
    rotate: 8deg;
  }
  80% {
    rotate: -4deg;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-rdr,.uvq09-rdr *,.uvq09-rdr *::before,.uvq09-rdr *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");b.setAttribute('aria-pressed','false')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const b=t.querySelector(".bl");b.addEventListener("click",()=>b.setAttribute("aria-pressed",b.getAttribute("aria-pressed")==="true"?"false":"true"));return clr
}

export default function ToastRainRadar() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#0e7490",
          "--c2": "#94a3b8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-rdr"><button type="button" className="fire">Show again</button><div className="tt" role="status"><div className="hd"><span className="ic" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 15.5a4.5 4.5 0 0 1-.4-9A6 6 0 0 1 18 8a3.8 3.8 0 0 1-.5 7.5z" /></svg><i></i><i></i><i></i></span><span className="tx"><b>Rain in 15 minutes</b><small>Moderate from 18:15 to 18:40</small></span><button type="button" className="bl" aria-pressed="false" aria-label="Notify me when it starts"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 2h-15z" /><path d="M10 20.5a2 2 0 0 0 4 0" /></svg></button></div><div className="ch" aria-hidden="true"><i className="z" style={{ "--h": "4%", "--i": "0" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "1" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "2" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "3" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "4" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "5" } as CSSProperties}></i><i style={{ "--h": "12%", "--i": "6" } as CSSProperties}></i><i style={{ "--h": "24%", "--i": "7" } as CSSProperties}></i><i style={{ "--h": "40%", "--i": "8" } as CSSProperties}></i><i style={{ "--h": "58%", "--i": "9" } as CSSProperties}></i><i style={{ "--h": "74%", "--i": "10" } as CSSProperties}></i><i style={{ "--h": "88%", "--i": "11" } as CSSProperties}></i><i style={{ "--h": "95%", "--i": "12" } as CSSProperties}></i><i style={{ "--h": "84%", "--i": "13" } as CSSProperties}></i><i style={{ "--h": "66%", "--i": "14" } as CSSProperties}></i><i style={{ "--h": "52%", "--i": "15" } as CSSProperties}></i><i style={{ "--h": "44%", "--i": "16" } as CSSProperties}></i><i style={{ "--h": "36%", "--i": "17" } as CSSProperties}></i><i style={{ "--h": "26%", "--i": "18" } as CSSProperties}></i><i style={{ "--h": "18%", "--i": "19" } as CSSProperties}></i><i style={{ "--h": "11%", "--i": "20" } as CSSProperties}></i><i style={{ "--h": "6%", "--i": "21" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "22" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "23" } as CSSProperties}></i></div><div className="ax" aria-hidden="true"><span>Now</span><span>30 min</span><span>60 min</span></div></div></div>
      </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 “Minute-by-minute rain toast” block (Toasts) from AIMRAN Library to my project.

## What it is
Warns that rain is coming with a minute-by-minute bar chart that grows in as it appears and an alert you can switch on.

## Chosen settings
- Main color: #0e7490
- Secondary color: #94a3b8
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Lluvia en 15 minutos"

## 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
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq09-rdr {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 21em;
  height: 15em;
}

.uvq09-rdr .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-rdr .fire:active {
  scale: .96;
}

.uvq09-rdr .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-rdr .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  padding: .85em .95em .75em;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-rdr .hd {
  display: flex;
  align-items: center;
  gap: .7em;
}

.uvq09-rdr .ic {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: .8em;
  color: var(--c1);
  background: color-mix(in srgb,var(--c1) 14%,transparent);
  overflow: hidden;
}

.uvq09-rdr .ic svg {
  width: 1.45em;
  height: 1.45em;
  margin-top: -.4em;
}

.uvq09-rdr .ic i {
  position: absolute;
  top: 1.5em;
  left: .8em;
  width: .11em;
  height: .42em;
  border-radius: 1em;
  background: var(--c1);
  opacity: 0;
  animation: uvq09-rdr-d calc(0.8s / var(--k)) linear infinite;
}

.uvq09-rdr .ic i:nth-of-type(2) {
  left: 1.15em;
  animation-delay: calc(0.27s / var(--k));
}

.uvq09-rdr .ic i:nth-of-type(3) {
  left: 1.5em;
  animation-delay: calc(0.54s / var(--k));
}

.uvq09-rdr .tx {
  display: grid;
  flex: 1;
  gap: .1em;
}

.uvq09-rdr .tx b {
  font-size: .95em;
}

.uvq09-rdr .tx small {
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-rdr .bl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .bl svg {
  width: 1.1em;
  height: 1.1em;
  transform-origin: 50% 15%;
}

.uvq09-rdr .bl:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 11%,transparent);
}

.uvq09-rdr .bl:active {
  scale: .92;
}

.uvq09-rdr .bl:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-rdr .bl[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
}

.uvq09-rdr .bl[aria-pressed="true"] svg {
  animation: uvq09-rdr-r calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-rdr .ch {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 3.2em;
  margin-top: .75em;
  border-bottom: 1px solid color-mix(in srgb,var(--fg) 15%,transparent);
}

.uvq09-rdr .ch::before {
  content: "";
  position: absolute;
  left: 0;
  top: -.3em;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--fg);
}

.uvq09-rdr .ch i {
  flex: 1;
  height: var(--h);
  border-radius: .15em .15em 0 0;
  background: linear-gradient(var(--c1),color-mix(in srgb,var(--c1) 45%,transparent));
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1) calc((.3s + var(--i) * .03s) / var(--k));
}

.uvq09-rdr .ch i.z {
  background: color-mix(in srgb,var(--c2) 40%,transparent);
}

.uvq09-rdr .tt.in .ch i {
  transform: none;
}

.uvq09-rdr .ax {
  display: flex;
  justify-content: space-between;
  margin-top: .3em;
  font-size: .62em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

@keyframes uvq09-rdr-d {
  0% {
    transform: translateY(-.2em);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(.7em);
    opacity: 0;
  }
}

@keyframes uvq09-rdr-r {
  20% {
    rotate: 18deg;
  }
  40% {
    rotate: -14deg;
  }
  60% {
    rotate: 8deg;
  }
  80% {
    rotate: -4deg;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-rdr,.uvq09-rdr *,.uvq09-rdr *::before,.uvq09-rdr *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");b.setAttribute('aria-pressed','false')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const b=t.querySelector(".bl");b.addEventListener("click",()=>b.setAttribute("aria-pressed",b.getAttribute("aria-pressed")==="true"?"false":"true"));return clr
}

export default function ToastRainRadar() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#0e7490",
          "--c2": "#94a3b8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-rdr"><button type="button" className="fire">Show again</button><div className="tt" role="status"><div className="hd"><span className="ic" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 15.5a4.5 4.5 0 0 1-.4-9A6 6 0 0 1 18 8a3.8 3.8 0 0 1-.5 7.5z" /></svg><i></i><i></i><i></i></span><span className="tx"><b>Rain in 15 minutes</b><small>Moderate from 18:15 to 18:40</small></span><button type="button" className="bl" aria-pressed="false" aria-label="Notify me when it starts"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 2h-15z" /><path d="M10 20.5a2 2 0 0 0 4 0" /></svg></button></div><div className="ch" aria-hidden="true"><i className="z" style={{ "--h": "4%", "--i": "0" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "1" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "2" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "3" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "4" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "5" } as CSSProperties}></i><i style={{ "--h": "12%", "--i": "6" } as CSSProperties}></i><i style={{ "--h": "24%", "--i": "7" } as CSSProperties}></i><i style={{ "--h": "40%", "--i": "8" } as CSSProperties}></i><i style={{ "--h": "58%", "--i": "9" } as CSSProperties}></i><i style={{ "--h": "74%", "--i": "10" } as CSSProperties}></i><i style={{ "--h": "88%", "--i": "11" } as CSSProperties}></i><i style={{ "--h": "95%", "--i": "12" } as CSSProperties}></i><i style={{ "--h": "84%", "--i": "13" } as CSSProperties}></i><i style={{ "--h": "66%", "--i": "14" } as CSSProperties}></i><i style={{ "--h": "52%", "--i": "15" } as CSSProperties}></i><i style={{ "--h": "44%", "--i": "16" } as CSSProperties}></i><i style={{ "--h": "36%", "--i": "17" } as CSSProperties}></i><i style={{ "--h": "26%", "--i": "18" } as CSSProperties}></i><i style={{ "--h": "18%", "--i": "19" } as CSSProperties}></i><i style={{ "--h": "11%", "--i": "20" } as CSSProperties}></i><i style={{ "--h": "6%", "--i": "21" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "22" } as CSSProperties}></i><i className="z" style={{ "--h": "4%", "--i": "23" } as CSSProperties}></i></div><div className="ax" aria-hidden="true"><span>Now</span><span>30 min</span><span>60 min</span></div></div></div>
      </div>
    </>
  );
}
```

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