side-by-side comparison with a center divider.

Live preview

Before
After

Install

From your site folder, run:

jprot add BeforeAfter

That downloads the self-contained component into theme/components/BeforeAfter.js,

where it is picked up automatically — the same way as any built-in component.

To remove it later, just delete that file.

Use it as a homepage section

Add an entry to the sections: list in jprot.config.js:

sections: [
  { component: 'BeforeAfter', title: 'BeforeAfter' },
]

Use it inside a page

On its own line in any Markdown file, passing the props:

:::BeforeAfter beforeLabel="Before" afterLabel="After" before="https://picsum.photos/seed/b1/600/420" after="https://picsum.photos/seed/b2/600/420"

Props

PropTypeNote
beforestringleft image
afterstringright image
beforeLabelstringleft caption
afterLabelstringright caption

↩ Back to all elements