Playground
Effects with a playground let you change their props live and copy code that matches what you see.
Using the playground
Under the demo you will find the Playground panel:
- Move a slider, pick a colour, flip a switch or choose an option.
- The demo updates immediately, without reloading.
- The Usage block updates with the same values. Press Copy to take it.
- Reset returns every control to the effect's defaults.
For example, after raising the tilt on Tilt Card the usage block reads:
tsx
import { TiltCard } from "@/components/znverse/tilt-card/TiltCard";
<TiltCard maxTilt={18} perspective={900}>
Your content
</TiltCard>The import path matches where npx znverse add installs the component, so the snippet works straight after installing.
Control types
| Control | Used for |
|---|---|
| Slider | Numbers with a minimum, maximum and step, such as tilt in degrees or size in pixels |
| Colour | Hex colours |
| Switch | On or off props |
| Select | One of a fixed set of options |
| Text | Short strings |
Values always stay within the limits the effect declares.
Which effects have a playground
Tilt Card, Spotlight Card and Magnetic Button have playgrounds today, and more are added over time. Authors add one by declaring controls in the effect manifest; see Manifest reference.