Skip to content

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:

  1. Move a slider, pick a colour, flip a switch or choose an option.
  2. The demo updates immediately, without reloading.
  3. The Usage block updates with the same values. Press Copy to take it.
  4. 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

ControlUsed for
SliderNumbers with a minimum, maximum and step, such as tilt in degrees or size in pixels
ColourHex colours
SwitchOn or off props
SelectOne of a fixed set of options
TextShort 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.