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.
| Control | Type | Default | Preview limits |
|---|---|---|---|
accent | color | #38BDF8 | No additional limit in the metadata. |
fontSize | number | 13 | From 11 to 16; step 1 |
showLineDiff | boolean | true | No additional limit in the metadata. |
focusBlurOnHover | boolean | true | No 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.