Grain storage hero
Shown as Stook, a made-up product
Hero for a grain storage monitor: a serif banner headline over golden fields, and the Stook app as one glass window on the horizon, its bins each read as 18 sensors, the hot spot flagged and tonight's fans one click away.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/stook-hero.json?token=…"Adds the piece to components/propui/03-stook-hero/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- The first screen of a product that watches physical stock: a store, a warehouse, a cold room.
- Showing the real app above the fold, with a list on the left and the open record on the right.
- A product whose story is one warning and one action: a hot spot found, the fix set for tonight.
Something else fits when
- A page that needs to scroll into more sections under the hero: this one fills its parent and clips; Catalogue studio hero sits in normal flow with content under it.
- A product with no list-and-detail screen to show: a headline over a single product shot is lighter.
- A light, bright brand: Airline dispatch hero has the same kind of sky in daylight blue.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/03-stook-hero/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace FARM, NIGHT and BINS in data.ts with your own store; the list, counts, statuses, the store total and every sentence on the open bin are worked out from them. Change the headline, lede and menu links in Section.tsx.
Your data
Replace these and everything on screen follows.
BINSBin[]- Every row in the list and the open bin; list order is by id.
Bin{ id; name; crop; variety; tonnes; capacity; filled; moisture; safe; temps; fan; fanNote?; log; story }- One bin: temps[cable][depth] in °C feeds the sensor bar, the peak, the cable readings and the hot or wet status.
Bin.story{ kind: "temp" | "moisture"; line; points }- kind picks temperature or moisture as the big figure; line is the sentence under it. points is not drawn in this piece.
Bin.log{ when; what }[]- The activity list on the open bin; setting fans adds a Now line.
FARM{ name; person; initials }- The farm in the app bar, the live line under the lede and the name on the fan log line.
NIGHT{ from; to; low; hours }- Tonight's fan window, the air figure and the fan sentence.
CABLES, DEPTHSstring[], number[]- Cable letters and sensor depths in metres, used in every reading.
FAN_EFFECTRecord<binId, string>- What a night of fans does for a bin, added to the fan sentence.
AIR_NOWnumber- The air temperature beside the Bins heading.
Interactions
- Pick a bin in the list to open it on the right.
- Search bins by name, crop or variety.
- Switch the list between All, Watch (hot or wet) and Fans set; each shows its live count.
- Run fans for tonight on the open bin, then undo; on a bin already drying, stop the fans.
- Open Menu for the site links; it closes on a click outside, on Esc, or on picking a link.
Keyboard
- ↑or↓
- In the bin list, move to the previous or next bin and open it; wraps at the ends.
- Tab
- Move between controls; the bin list is one stop, on the open bin.
- EnterorSpace
- Press the focused button: a bin, a filter, a fan action or Menu.
- Esc
- Close the menu when it is open.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- The app is a region labelled "Stook, a working example"; the list is an aside labelled Bins, and the open bin is labelled by its heading.
- The open bin row carries aria-current, and filters are toggle buttons with aria-pressed in a labelled group.
- Each sensor bar is an image with a label giving the sensor count and how many are above 15 °C.
- The fan card and activity are a polite live region, so setting or undoing fans is announced.
- Readings are ticked or flagged with an icon and also say it in words ("past 15 °C", "drying to").
- The search field has its own label; the Menu button has aria-expanded and aria-controls.
- The sky and the hills are hidden from screen readers. The glass gets a more solid fill under high contrast, reduced transparency, or with no backdrop blur, and a border in forced colours.
Motion
- The one moment: the app rises 24px and fades in over 0.9s as the page opens; the caption line fades up just before it.
- The open bin swaps with a 0.22s fade and a slight blur; the selected row and the filter underline slide on a spring.
- Big figures glide to their new value on a spring, and the sensor bar fills cable by cable when a bin opens.
- Behind it, a WebGL sky drifts slowly sideways, near clouds faster than far ones.
- Reduced motion: the sky holds still, figures jump straight to their value, and Motion transitions are cut by MotionConfig reducedMotion="user".
Responsive
- The hero fills its parent's height and clips; the app runs off the bottom edge rather than scrolling.
- Up to 1080px: side padding tightens, the live line drops under the button, the list narrows to 260px, the fan card moves under the readings, and the farm name in the app bar hides.
- Up to 680px: the headline drops to 36px, the app nav hides, the list becomes a horizontal strip of 232px cards that snap as you swipe, and the store total hides.
- Cable readings stack their value under the label on a phone.
Performance
- The sky is one WebGL canvas drawn every animation frame while mounted; it does not pause off screen, and under reduced motion it keeps drawing a still sky.
- The canvas resolution is capped at 1.5× device pixels.
- The hills are one static SVG with noise filters, drawn once.
- The glass uses backdrop-filter blur (44px on the app, 24px on the menu capsule).
- Four local font files; no images.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- A section in normal page flow that takes its height from its parent: give the parent a height (for example 100svh). Every class starts with sk- under .sk.
- Keep figures in data.ts. Peak, hot, wet, the store total and counts are derived (hottest, isHot, isWet, STORED, CAPACITY); never type them into the markup.
- A bin is hot when its warmest sensor is more than 4 °C over its median; sensors tone warm from 13 °C and hot from 15 °C. Keep 18 sensors per bin (3 cables × 6 depths), as median() reads the middle two.
- Some text is still fixed in Section.tsx: the bin open on load ("3"), "Since 6 Nov" and the 6 °C top of tonight's air. Change them with the data.
- Each -webkit-backdrop-filter sits in its own @supports block; keep it that way or Chrome loses the blur.
/p/stook-hero/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.