Component Playground

A component for displaying a component playground

Default
Default component playground

Compare playground

Adjust interactive compare props live

first image
second image
1<Compare
2 initialSliderPercentage={40}
3 slideMode="drag"
4 showHandlebar
5 autoplay={false}
6 autoplayDuration={3000}
7/>

Controls

initialSliderPercentage
slideMode
showHandlebar
autoplay
autoplayDuration
1<Compare
2 initialSliderPercentage={40}
3 slideMode="drag"
4 showHandlebar
5 autoplay={false}
6 autoplayDuration={3000}
7/>

Controls

initialSliderPercentage
slideMode
showHandlebar
autoplay
autoplayDuration

Props

NameTypeDefaultDescription
controlsRecord<string, PlaygroundControlConfig>undefinedLive playground props; omit (or use an empty object) to hide the controls toolbar toggle and panel so children render exactly as authored—useful for fixed assets or non-interactive previews
controlsEnabledbooleantrueQuickly turn controls behavior on/off without removing `controls`; when false, preview renders as static
showPreviewResetbooleanfalseShows Reset animation in the toolbar; remounts the preview so motion / in-view demos can run again
dynamicCodebooleantrueWhen at least one control is configured, rewrites the root JSX snippet in the Code tab from the static `code` template using the current values (falls back to `code` if parsing fails); ignored when `controls` is omitted
defaultControlsOpenbooleantrueWhen live controls are present, whether the controls block under the preview starts visible; hiding it does not reset control values
controlsVisibilityToggle"switch" | "checkbox""switch"When live controls are present, toolbar control used to show or hide the controls section
embeddedbooleanfalseSofter outer chrome when nested in docs cards or other containers