Skip to content

Qubaish/rc-code-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Formatter Component For React

npm npm gzip size

Description

  • 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

Installation

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

License

MIT