# Weather and calendar widget

> A frosted glass card with the current temperature on top and your next plan underneath, iPhone widget style.

- Category: [Cards](https://library.aimran.es/components/cards)
- Built with: React + Motion
- Live editor: https://library.aimran.es/blocks/ios-weather-widget
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

This little card borrows the look of iPhone home screen widgets: city and temperature at the top, the next event below. It fits a travel app showing the weather at your destination, a hotel guest page, a restaurant booking confirmation or a personal dashboard. People looking for a weather widget in React often just need this kind of tidy summary.

The data here is static, so plug in your own weather source and events. The glass effect needs a photo or gradient behind it to look right. Try the temperature control to see how the layout handles negative and two-digit numbers.

## Code

### React (Motion)

```tsx
import { motion } from "framer-motion";
import { CalendarDays, CloudSun } from "lucide-react";

interface WeatherWidgetProps {
  temp?: number;
  city?: string;
  eventDate?: string;
  eventTitle?: string;
}

export default function WeatherWidget({
  temp = 23,
  city = "Madrid",
  eventDate = "Friday, 25",
  eventTitle = "Dinner · 8:30 PM",
}: WeatherWidgetProps) {
  return (
    <motion.div
      whileHover={{ scale: 1.02 }}
      transition={{ type: "spring", stiffness: 300, damping: 30 }}
      className="w-64 rounded-[28px] bg-white/70 p-5 text-[#1d1d1f] shadow-[0_1px_2px_rgba(0,0,0,0.03),0_8px_28px_rgba(0,0,0,0.05)] backdrop-blur-[20px] dark:bg-black/70 dark:text-[#f5f5f7]"
    >
      <div className="flex justify-between">
        <div>
          <p className="text-xs text-[#86868b]">{city}</p>
          <strong className="text-4xl font-medium">{temp}°</strong>
        </div>
        <CloudSun className="h-10 w-10 text-[#0071e3]" />
      </div>
      <div className="my-4 h-px bg-black/10 dark:bg-white/10" />
      <div className="flex items-center gap-3">
        <CalendarDays className="h-8 w-8 text-[#0071e3]" />
        <div>
          <b className="text-sm">{eventDate}</b>
          <p className="text-xs text-[#86868b]">{eventTitle}</p>
        </div>
      </div>
    </motion.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 “Weather and calendar widget” block (Cards) from AIMRAN Library to my project.

## What it is
A frosted glass card with the current temperature on top and your next plan underneath, iPhone widget style.

## Chosen settings
- Temperature: 23° (from -5 to 40°)

## 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 React + TypeScript, with framer-motion for the animation and lucide-react for the icons. 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 { motion } from "framer-motion";
import { CalendarDays, CloudSun } from "lucide-react";

interface WeatherWidgetProps {
  temp?: number;
  city?: string;
  eventDate?: string;
  eventTitle?: string;
}

export default function WeatherWidget({
  temp = 23,
  city = "Madrid",
  eventDate = "Friday, 25",
  eventTitle = "Dinner · 8:30 PM",
}: WeatherWidgetProps) {
  return (
    <motion.div
      whileHover={{ scale: 1.02 }}
      transition={{ type: "spring", stiffness: 300, damping: 30 }}
      className="w-64 rounded-[28px] bg-white/70 p-5 text-[#1d1d1f] shadow-[0_1px_2px_rgba(0,0,0,0.03),0_8px_28px_rgba(0,0,0,0.05)] backdrop-blur-[20px] dark:bg-black/70 dark:text-[#f5f5f7]"
    >
      <div className="flex justify-between">
        <div>
          <p className="text-xs text-[#86868b]">{city}</p>
          <strong className="text-4xl font-medium">{temp}°</strong>
        </div>
        <CloudSun className="h-10 w-10 text-[#0071e3]" />
      </div>
      <div className="my-4 h-px bg-black/10 dark:bg-white/10" />
      <div className="flex items-center gap-3">
        <CalendarDays className="h-8 w-8 text-[#0071e3]" />
        <div>
          <b className="text-sm">{eventDate}</b>
          <p className="text-xs text-[#86868b]">{eventTitle}</p>
        </div>
      </div>
    </motion.div>
  );
}
```

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