Package: https://www.npmjs.com/package/react-code-box <br/> Package Repo: https://github.com/borisdedejski/react-code-box<br/> Demo: https://github.com/borisdedejski/react-code-box-demo
npm install react-code-boxPackage: https://www.npmjs.com/package/react-code-box
Package Repo: https://github.com/borisdedejski/react-code-box
Demo: https://github.com/borisdedejski/react-code-box-demo
yarn add react-code-boxnpm install react-code-boxstyle and className.Props that CodeBox receives are:
variant: "dark" | "light";
title: string;
code: string;
style?: CSSProperties;
className?: string;
id: string;
It comes in two variants, it can rather be dark or light.
import React from "react";
import CodeBox from "react-code-box/dist/index";const TodoApp = () => {
let code =
var a = 1 return (
title="~code-box-dark.js"
variant="dark"
code={code}
id="code-box-dark"
style={{marginTop:'200px'}}
/>
);
};
export default TodoApp;
`$3
1. Clone the repo
git clone https://github.com/borisdedejski/react-code-box-demo
2. Install dependencies
yarn install
3. Start
yarn start`**Note: Feel free to contribute