1.1.2 • Published 4 years ago

react-code-box v1.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Package: 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

alt text alt text alt text

Demo

https://github.com/borisdedejski/react-code-box-demo

Installation

With Yarn: yarn add react-code-box With npm: npm install react-code-box

Usage

You can override classes and styles on the CodeBox via its props style 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.

Example

import React from "react";
import CodeBox from "react-code-box/dist/index";

const TodoApp = () => {

  let code = `var a = 1`  

  return (
      <CodeBox
        title="~code-box-dark.js"
        variant="dark"
        code={code}
        id="code-box-dark"
        style={{marginTop:'200px'}}
      />
  );
};

export default TodoApp;

Test

  1. Clone the repo git clone https://github.com/borisdedejski/react-code-box-demo
  2. Install dependencies yarn install
  3. Start yarn start

Feel free to contribute as well

**Note: Feel free to contribute

1.1.1

4 years ago

1.1.0

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.1.2

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago