Skip to content

pastetaste

Climate Tiles

DataInteractionCards

A square room-climate widget: a tall tile you drag to set the heating, a CO₂ tile coloured by its air-quality band and a humidity tile drawn as moving water. The small tiles toggle a vent and a dryer.

Paste it into Claude Code: it installs the component, asks for your brand and content, and places it on the page you name.

Install

Or by hand, in a Next.js project with shadcn set up. It writes components/pastetaste/climate-tiles.tsx.

npx shadcn@latest add https://pastetaste.com/r/climate-tiles.json

Prompt

Install the pastetaste component "Climate Tiles" (climate-tiles) into this Next.js project and use it.

What it is: A square room-climate widget: a tall tile you drag to set the heating, a CO₂ tile coloured by its air-quality band and a humidity tile drawn as moving water. The small tiles toggle a vent and a dryer.

Before you place it, ask me (one short message, in my language; "skip" = sensible default): which page and section it goes in, my brand colour (hex), the text, labels or images it should show, and whether I want my logo or my own copy in the demo content. Then:

Steps:
1. If the project has no components.json, run: npx shadcn@latest init -y -d. Then run: npx shadcn@latest add https://pastetaste.com/r/climate-tiles.json
   (it writes components/pastetaste/climate-tiles.tsx; install any npm packages it reports).
2. Import it: import { ClimateTiles } from "@/components/pastetaste/climate-tiles" (check the file for the exact named export).
3. Put it where it fits on the page I name, keep the rest of the page untouched, and pass props for my colours instead of editing the installed file.
4. It does not depend on Tailwind; colours come from CSS variables (--pt-*) or props.
5. It supports prefers-reduced-motion with a still state; do not remove it.

Props (all optional unless the type has no default):
- temperature / defaultTemperature: number = — / 68 — Heating setpoint. Pass temperature to control it, or defaultTemperature for an uncontrolled slider.
- onTemperatureChange: (value: number) => void — Called once per step while dragging, and on taps and key presses.
- roomTemperature: number — Current room reading. Adds a status line: Heating, Cooling or Holding with the reading.
- min / max / step: number = 60 / 80 / 1 — Slider range and precision; a step of 0.5 shows one decimal.
- unit: 'F' | 'C' = 'F' — Letter after the degree sign.
- co2: number = 684 — CO₂ in ppm. The number counts to each new reading and the tile cross-fades to the band's colour.
- co2Bands: ClimateBand[] = Fresh ≤ 800, Stuffy ≤ 1200, Open a window — Bands from low to high: { upTo, label, color, ink }. Exported as CO2_BANDS.
- ventilating / onVentilatingChange: boolean / (on: boolean) => void = uncontrolled, off — Ventilation toggle on the CO₂ tile; the fan glyph spins up and coasts down.
- humidity: number = 64 — Relative humidity 0 to 100: the water level. Each change moves the level and kicks the surface in proportion.
- humidityBands: ClimateBand[] = Dry ≤ 30, Comfortable ≤ 60, Humid — Words under the humidity reading. Exported as HUMIDITY_BANDS.
- drying / onDryingChange: boolean / (on: boolean) => void = uncontrolled, off — Dryer toggle on the humidity tile.
- temperatureLabel / co2Label / humidityLabel: string / ReactNode / string = 'Room temp.' / CO₂ / 'Humidity' — Captions under the numbers.
- width: number | string = 'min(100%, 420px)' — Widget width; the height equals it and everything inside scales with it. Under 300 px the status lines hide.

Live preview: https://pastetaste.com/c/climate-tiles
Then run the dev server, check it in the browser at desktop and mobile width, and tell me the page URL.

Props 13

PropTypeDefaultDescription
temperature / defaultTemperaturenumber— / 68Heating setpoint. Pass temperature to control it, or defaultTemperature for an uncontrolled slider.
onTemperatureChange(value: number) => void-Called once per step while dragging, and on taps and key presses.
roomTemperaturenumber-Current room reading. Adds a status line: Heating, Cooling or Holding with the reading.
min / max / stepnumber60 / 80 / 1Slider range and precision; a step of 0.5 shows one decimal.
unit'F' | 'C''F'Letter after the degree sign.
co2number684CO₂ in ppm. The number counts to each new reading and the tile cross-fades to the band's colour.
co2BandsClimateBand[]Fresh ≤ 800, Stuffy ≤ 1200, Open a windowBands from low to high: { upTo, label, color, ink }. Exported as CO2_BANDS.
ventilating / onVentilatingChangeboolean / (on: boolean) => voiduncontrolled, offVentilation toggle on the CO₂ tile; the fan glyph spins up and coasts down.
humiditynumber64Relative humidity 0 to 100: the water level. Each change moves the level and kicks the surface in proportion.
humidityBandsClimateBand[]Dry ≤ 30, Comfortable ≤ 60, HumidWords under the humidity reading. Exported as HUMIDITY_BANDS.
drying / onDryingChangeboolean / (on: boolean) => voiduncontrolled, offDryer toggle on the humidity tile.
temperatureLabel / co2Label / humidityLabelstring / ReactNode / string'Room temp.' / CO₂ / 'Humidity'Captions under the numbers.
widthnumber | string'min(100%, 420px)'Widget width; the height equals it and everything inside scales with it. Under 300 px the status lines hide.
View all →