- Demo : Live Demo
- Format your code with different color schemes
- Very light weight and very useful to add code logic in your blogs
- Stay tunned more functionalities are coming
npm install rc-code-formatter
import React from 'react';
import CodeFormatter from 'rc-code-formatter';
const myCode = `
import React from 'react';
import ReactDom from 'react-dom';
function App() {
return (
<CodeFormatter theme="dark">
{myCode}
</CodeFormatter>
)
}
`;
function App() {
return (
<CodeFormatter theme="dark">
{myCode}
</CodeFormatter>
)
}
Props | Type | Description |
---|---|---|
theme | string | Property to define your code formatter either light or dark |
children | string | Template literals string of your code |
MIT