Sections
FreeNewWebGLCanvasSauna on the 31st floor, regulars' notes written with a finger on the steamed window
Use Misted as the testimonial section of a spa, hotel, gym or any warm place with regulars: each note is written with a fingertip on a steamed window, the city sharp and dark through the letters.
pnpm dlx shadcn@latest add @motionkit/mistednpx shadcn@latest add @motionkit/mistedyarn dlx shadcn@latest add @motionkit/mistedbunx --bun shadcn@latest add @motionkit/mistedRequires the @motionkit namespace in components.json. See Installation.
The files land in components/sections/.
import { Misted } from "@/components/sections/misted"
export default function Page() {
return (
<Misted
image="/view-at-dusk.jpg"
content={{
title: "What our guests write on the glass",
brand: "Hammam 4",
testimonials: [
{ quote: "Two hours, no phone, best decision of the week.", name: "Ana", locker: "12" },
{
quote: "The steam room at 7 am is the quietest place in town.",
name: "Tom",
locker: "40",
},
],
}}
/>
)
}Every text sits in one typed content prop; each key you pass replaces the default copy (a sauna
on the 31st floor), so pass at least testimonials and title.
| Key | Type | Notes |
|---|---|---|
testimonials | { quote, name, locker?, detail? }[] | One note per guest; keep each quote under ~24 words. |
title | ReactNode | The heading (h2), set small on the sill. |
brand | ReactNode | Burnt into the sill; null hides it. |
next | string | The ladle button that shows the next guest. |
nextHint | string | Small line under next; "" hides it. |
previous | string | The button back. |
position | (shown: number[], total: number) => string | Position line next to the thermometer, also read by screen readers. |
locker | string | Prefix of the locker number on the tag. |
window | string | Accessible name of the window. |
temperature sets the thermometer (each ladle adds 2 °C that fade back); defaultIndex and
onIndexChange control the first guest.
pane (default): one window. Preview it with ?demo=default.triptych: three panes divided by mullions, three guests at once (one below 760 px). Preview it
with ?demo=triptych.porthole: a round window for one short line, for sidebars. Preview it with ?demo=porthole.The demo image stays on this site and is not installed: pass your own through image.
| Prop | Type | Ratio | Transparent | Max weight | Notes |
|---|---|---|---|---|---|
image | string | any (cover crop), 3:2 best | no | 500 KB | The view behind the glass, about 2000 px wide. The mist is lifted and the letters darkened, so any photograph stays readable; dusk cities with lit windows work best. |
imageFrame picks the crop: bottom drops the foreground (share of the height kept), x and y
place the crop. Use WebP or JPEG on your own origin or with CORS headers. Without image a dusk
gradient from cobalt to amber stands behind the glass.
Prop
Type
Every colour is a prop and takes any CSS colour: hex, RGB, HSL or OKLCH. mist is the
condensation, cobalt the deep tone of the city in the letters, amber the lit windows in the
mist, cedar the frame, sill and tags, ink the text on the sill, mercury the thermometer.
<Misted
colors={{
amber: "#f2b84b",
cedar: "#b98a5e",
cobalt: "#1f3f7a",
mist: "#e3ebf0",
ink: "#1c2433",
mercury: "#c8452c",
}}
/>use-prefers-reduced-motion, fx-runtime, fx-glsl, section-runtime.stack: the window becomes 4:5 with one note, the sill stacks under it. On touch screens a slow
palm wipes an arc every 10 s on its own; vertical scroll is never blocked.
One still pane with the note fully written and its runs at rest; the ladle swaps the note with a 200 ms cross-fade, no steam.
ogl loads the first time the section nears the viewport; until then (and without WebGL) a
blurred copy of the image under a mist wash stands in, with the note in ink.pnpm size).Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 16.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
—
One still pane with the note fully written and its runs at rest; the ladle swaps the note with a 200 ms cross-fade, no steam.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)