Skip to contentSkip to Content
Feedback
ComponentsBeforeAfter

BeforeAfter

Show two related code snippets side by side. It works well for migration notes, config changes, and generated output comparisons.

API

PropTypeDefaultDescription
beforestring—Left code snippet.
afterstring—Right code snippet.
beforeLabelstring"Before"Left label.
afterLabelstring"After"Right label.
languagestring—Accepted and ignored.

Example

RST
.. note:: Install Folio first.
MDX
<Callout type="note">
Install Folio first.
</Callout>
<BeforeAfter before={`.. note:: Install Folio first.`} after={`<Callout type="note">Install Folio first.</Callout>`} beforeLabel="RST" afterLabel="MDX" />