Browse the docs
Foundations / PlopProvider

PlopProvider

Sets the surface, theme and feedback settings for everything inside it, and renders the filters, ink-burst layer and toast zone.

Client componentSince v0.1
Poster
Cutting mat
Notebook
Kraft
Riso

Change every prop live in the playground.

Props

PropTypeDefaultWhat it does
childrenReactNodenone—
hapticsbooleanfalseVibrate on press and toggle (phones only). Inherits from a parent PlopProvider, else `true`.
paintbooleantruePaint the surface's background and text color on this element.
reducedMotion"system" | "always" | "never"none`system` follows prefers-reduced-motion. Inherits from a parent PlopProvider, else `system`.
soundbooleanfalseSoft "plop" sounds. Inherits from a parent PlopProvider, else off; turn on only after a person asks for it.
stickerShadow"soft" | "solid" | "stripes" | "outline" | "none"softThe default shadow for every sticker inside: `soft`, `solid`, `stripes`, `outline` or `none`. A sticker's own `shadow` wins.
surface"poster" | "mat" | "notebook" | "kraft" | "riso"noneThe paper everything sits on. Leave it out to keep the surrounding surface (a parent provider's, or the page's `data-plop-surface`; poster when there is none).
theme"system" | "light" | "dark"system`system` follows prefers-color-scheme.
toastBackdrop"solid" | "none" | "dots"solidWhat shows behind a toast: `solid` (a faint gradient wash), `dots` (a comic halftone screen) or `none`.
toasterbooleantrueRender the toast zone that `toast()` shows messages in.

Also takes every attribute of <div> (277 more, e.g. onClick, className, aria-*).

Use it well

DoPut one provider near the root and give people a haptics and sound switch (this site's header has one). Nested providers inherit those settings, so one switch covers the page.
Don'tTurn sound on by default. Let people choose it.

Accessibility

  • theme="system" follows prefers-color-scheme.
  • reducedMotion="system" follows prefers-reduced-motion.
  • Haptics always pair with a visual change.
Five stamps!

All aboard.

You took the whole tour. Here's Holo Pip, a foil sticker for riders who finish. It's in your playground tray now, for good.