@lunit/mdx-code-block
v1.0.0
Published
MDX JS Code Block Components
Downloads
5
Readme
How to Use
npm install @lunit/mdx-code-block
import { MDXCodeBlock } from '@lunit/mdx-code-block';
const components = {
pre: props => <div {...props} />,
code: MDXCodeBlock,
};
export function App() {
return (
<MDXProvider components={components}>
<Content/>
</MDXProvider>
);
}
import { CodeBlock } from '@lunit/mdx-code-block';
function Component(sourceCode: string) {
return (
<CodeBlock language="js">{sourceCode}</CodeBlock>
)
}