Skip to content

Code tag to show code in browser as in code editor.

Notifications You must be signed in to change notification settings

SVladikO/react_code_tag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is ReactCodeTag ?

ReactCodeTag is a react component which will show your code example in more readable way. With rows number, saved structure, possibility to copy, styled as you wish.

1. Install:

$ npm i react-code-tag

or

$ yarn add react-code-tag

2. Usage

import CodeTag from "react_code_tag"

const yourCode = function () {
    console.log('hello')
}

...
render () {
   return <CodeTag code={yourCode} />
}

example

3. You can customize colors too:

const style = {
  codeColor: '#11fffb',
  borderColor: '#ff0303',
  backgroundColor: '#4f67d1',
  rowNumberColor: '#000',
}

...
render () {
   return <CodeTag code={/* your code */} style={style}/>
}

example

4. Contribute:

4.1 git clone https://github.com/SVladikO/react-code-tag.git

4.2 cd react-code-tag

4.3 npm install

4.4 npm run start

About

Code tag to show code in browser as in code editor.

Resources

Stars

Watchers

Forks

Packages

No packages published