Code snippet preview and interactions for React.
npm install react-cdxCode snippet rendering and interaction library for React.
- 💅 Styling-agnostic (raw CSS, CSS-in-JS, pre-built themes).
- 🎯 Focused lines.
- 💎 Interactive code tokens.
``bash`
npm install react-cdx
`jsx
import React from 'react'
import { Code } from 'react-cdx'
export function Example() {
return (
code={
function multiply(a, b) {
return a * b
}
}``
/>
)
}