Skip to content
Menu

Data display

Before/After Code Diff

Before/After Code Diff: Two code panels side by side, labeled before and after, with added and removed lines tinted and a hover focus effect.

Using Before/After Code Diff

Before/After Code Diff uses the wide preview frame with a dark theme setting.

Customize the preview

These controls are passed to the demo. Defaults and limits describe the preview; consult the implementation for its full prop API.

ControlTypeDefaultPreview limits
accentcolor#38BDF8No additional limit in the metadata.
fontSizenumber13From 11 to 16; step 1
showLineDiffbooleantrueNo additional limit in the metadata.
focusBlurOnHoverbooleantrueNo additional limit in the metadata.
Which frameworks are available for Before/After Code Diff?

Before/After Code Diff is available for React, Vue, Svelte, Astro, HTML. The live preview uses React; the source observations below apply to index.tsx. Check the selected port before relying on the same interactions.

What does Before/After Code Diff depend on?

The React metadata lists these npm dependencies beyond React: clsx.

What accessibility details are visible in Before/After Code Diff?

The React source for Before/After Code Diff includes: attributes and handlers (aria-hidden). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.

How does Before/After Code Diff handle reduced motion?

The source scan found no direct useReducedMotion() or matchMedia preference read in Before/After Code Diff's index.tsx. Check the full implementation, shared styles and selected port with reduced motion enabled; these observations do not establish that every animation stops.

Connect your agent

Related open components