import { Weather } from "@replicas/ui";

const days = [
  { label: "Today", condition: "partly-cloudy", high: "21°", low: "12°" },
  { label: "Fri", condition: "clear", high: "23°", low: "13°" },
  { label: "Sat", condition: "cloudy", high: "19°", low: "12°" },
  { label: "Sun", condition: "rain", high: "16°", low: "11°" },
  { label: "Mon", condition: "storm", high: "15°", low: "10°" },
] as const;

export default function WeatherDemo() {
  return (
    <Weather.Root condition="partly-cloudy" style={{ width: "100%", maxWidth: 420 }}>
      <Weather.Header>
        <Weather.Location>San Francisco</Weather.Location>
        <Weather.Summary>Partly cloudy</Weather.Summary>
      </Weather.Header>
      <Weather.Current>
        <Weather.Icon condition="partly-cloudy" />
        <Weather.Temperature>18°</Weather.Temperature>
        <Weather.Details>
          <Weather.Detail>H 21° L 12°</Weather.Detail>
          <Weather.Detail>Wind 14 km/h</Weather.Detail>
          <Weather.Detail>Humidity 72%</Weather.Detail>
        </Weather.Details>
      </Weather.Current>
      <Weather.Forecast>
        {days.map((day) => (
          <Weather.Day key={day.label} {...day} />
        ))}
      </Weather.Forecast>
    </Weather.Root>
  );
}

Prompt

Copy Prompt hands your agent everything it needs to build the Weather in the Notion style: the measured tokens, the CSS and the structure.

Show Prompt
# Notion Weather

Current conditions and a short forecast.

Build a Weather in this project that looks and behaves like Notion's. Measured from the running Notion app (notion.com). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or Base UI primitives if it has none.

Fidelity: Concept, not a real feature. Designed from Notion's grey callout block and secondary icon colour. Concept built on a grey callout, since Notion has no weather card.

## Tokens

| Token | Light | Dark |
| --- | --- | --- |
| `--c-texPri` | `#2c2c2b` | `#f0efed` |
| `--c-texSec` | `#7d7a75` | `#ada9a3` |
| `--c-texTer` | `#a19e99` | `#7d7a75` |
| `--c-icoPri` | `#383836` | `#e6e5e3` |
| `--c-icoSec` | `#8e8b86` | `#ada9a3` |
| `--ca-borSecTra` | `#2a1c0012` | `#fffff315` |
| `--c-bacSec` | `#f9f8f7` | `#202020` |
| `--font-size-mini` | `12px` | `12px` |
| `--font-size-small` | `14px` | `14px` |
| `--font-size-title1` | `40px` | `40px` |
| `--font-weight-medium` | `500` | `500` |
| `--font-weight-semibold` | `600` | `600` |
| `--radius-callout` | `8px` | `8px` |

## CSS

Scoped under `[data-style="notion"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.

```css
[data-style="notion"] {
  .ui-weather {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius-callout);
    background-color: var(--c-bacSec);
    color: var(--c-texPri);
    font-family: inherit;
    font-size: var(--font-size-small);
    line-height: 20px;
  }

  .ui-weather-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
  }

  .ui-weather-location {
    color: var(--c-texPri);
    font-weight: var(--font-weight-semibold);
  }

  .ui-weather-summary {
    color: var(--c-texSec);
  }

  .ui-weather-current {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .ui-weather-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--c-icoSec);
  }

  .ui-weather-current .ui-weather-icon {
    width: 40px;
    height: 40px;
    color: var(--c-icoPri);
  }

  .ui-weather-temperature {
    color: var(--c-texPri);
    font-size: var(--font-size-title1);
    font-weight: var(--font-weight-semibold);
    line-height: 48px;
    font-variant-numeric: tabular-nums;
  }

  .ui-weather-details {
    display: flex;
    flex-direction: column;
    margin-inline-start: auto;
    text-align: end;
  }

  .ui-weather-detail {
    color: var(--c-texSec);
    font-size: var(--font-size-mini);
    line-height: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .ui-weather-forecast {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 4px;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--ca-borSecTra);
    list-style: none;
  }

  .ui-weather-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
  }

  .ui-weather-day-label {
    color: var(--c-texSec);
    font-size: var(--font-size-mini);
    line-height: 16px;
  }

  .ui-weather-high {
    color: var(--c-texPri);
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
  }

  .ui-weather-low {
    margin-top: -4px;
    color: var(--c-texTer);
    font-size: var(--font-size-mini);
    line-height: 16px;
    font-variant-numeric: tabular-nums;
  }
}
```

## Structure

How Replicas assembles it on Base UI.

```tsx
import type { ComponentProps, ReactNode } from "react";
import { join } from "./utils";

type Condition = "clear" | "partly-cloudy" | "cloudy" | "rain" | "storm" | "snow";

const icons: Record<Condition, ReactNode> = {
  clear: (
    <>
      <circle cx="12" cy="12" r="4.5" stroke="currentColor" strokeWidth="1.5" />
      <path d="M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
    </>
  ),
  "partly-cloudy": (
    <>
      <path d="M9 3.5v1.5M3.5 9H5M5.1 5.1l1 1M12.9 5.1l-1 1" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
      <path d="M6.2 11a3.25 3.25 0 0 1 5.9-2.4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
      <path d="M8 19.5h9a3.5 3.5 0 0 0 .4-6.98A5 5 0 0 0 8 13.5a3 3 0 0 0 0 6z" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round" />
    </>
  ),
  cloudy: <path d="M7 18.5h10a4 4 0 0 0 .5-7.97A5.5 5.5 0 0 0 7 11.5a3.5 3.5 0 0 0 0 7z" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round" />,
  rain: (
    <>
      <path d="M7 15h10a4 4 0 0 0 .5-7.97A5.5 5.5 0 0 0 7 8a3.5 3.5 0 0 0 0 7z" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M8.5 18l-1 2.5M12.5 18l-1 2.5M16.5 18l-1 2.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
    </>
  ),
  storm: (
    <>
      <path d="M7 15h10a4 4 0 0 0 .5-7.97A5.5 5.5 0 0 0 7 8a3.5 3.5 0 0 0 0 7z" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M12.5 16l-2 3h3l-2 3" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
    </>
  ),
  snow: (
    <>
      <path d="M7 15h10a4 4 0 0 0 .5-7.97A5.5 5.5 0 0 0 7 8a3.5 3.5 0 0 0 0 7z" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round" />
      <path d="M8.5 19h.01M12 20.5h.01M15.5 19h.01" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
    </>
  ),
};

type IconProps = Omit<ComponentProps<"svg">, "children"> & { condition: Condition };

function Icon({ className, condition, ...props }: IconProps) {
  return (
    <svg className={join("ui-weather-icon", className)} viewBox="0 0 24 24" fill="none" data-condition={condition} aria-hidden {...props}>
      {icons[condition]}
    </svg>
  );
}

const part = (name: string) =>
  function Part({ className, ...props }: ComponentProps<"div">) {
    return <div className={join(`ui-weather-${name}`, className)} {...props} />;
  };

const text = (name: string) =>
  function Text({ className, ...props }: ComponentProps<"span">) {
    return <span className={join(`ui-weather-${name}`, className)} {...props} />;
  };

type RootProps = ComponentProps<"div"> & { condition?: Condition };

function Root({ className, condition, ...props }: RootProps) {
  return <div className={join("ui-weather", className)} data-condition={condition} {...props} />;
}

function Forecast({ className, ...props }: ComponentProps<"ol">) {
  return <ol className={join("ui-weather-forecast", className)} {...props} />;
}

type DayProps = Omit<ComponentProps<"li">, "children"> & { label: ReactNode; condition: Condition; high: ReactNode; low: ReactNode };

function Day({ className, label, condition, high, low, ...props }: DayProps) {
  return (
    <li className={join("ui-weather-day", className)} {...props}>
      <span className="ui-weather-day-label">{label}</span>
      <Icon condition={condition} />
      <span className="ui-weather-high">{high}</span>
      <span className="ui-weather-low">{low}</span>
    </li>
  );
}

export const Weather = {
  Root,
  Header: part("header"),
  Location: text("location"),
  Summary: text("summary"),
  Current: part("current"),
  Icon,
  Temperature: text("temperature"),
  Details: part("details"),
  Detail: text("detail"),
  Forecast,
  Day,
};
```

## Example

```tsx
import { Weather } from "@replicas/ui";

const days = [
  { label: "Today", condition: "partly-cloudy", high: "21°", low: "12°" },
  { label: "Fri", condition: "clear", high: "23°", low: "13°" },
  { label: "Sat", condition: "cloudy", high: "19°", low: "12°" },
  { label: "Sun", condition: "rain", high: "16°", low: "11°" },
  { label: "Mon", condition: "storm", high: "15°", low: "10°" },
] as const;

export default function WeatherDemo() {
  return (
    <Weather.Root condition="partly-cloudy" style={{ width: "100%", maxWidth: 420 }}>
      <Weather.Header>
        <Weather.Location>San Francisco</Weather.Location>
        <Weather.Summary>Partly cloudy</Weather.Summary>
      </Weather.Header>
      <Weather.Current>
        <Weather.Icon condition="partly-cloudy" />
        <Weather.Temperature>18°</Weather.Temperature>
        <Weather.Details>
          <Weather.Detail>H 21° L 12°</Weather.Detail>
          <Weather.Detail>Wind 14 km/h</Weather.Detail>
          <Weather.Detail>Humidity 72%</Weather.Detail>
        </Weather.Details>
      </Weather.Current>
      <Weather.Forecast>
        {days.map((day) => (
          <Weather.Day key={day.label} {...day} />
        ))}
      </Weather.Forecast>
    </Weather.Root>
  );
}
```

## Foundations

The rest of the Notion style, as a skill: https://replicas.raphaelsalaja.com/skills/notion/SKILL.md