cn-react-coda
TypeScript icon, indicating that this package has built-in type declarations

1.1.8 • Public • Published

CN React Coda

Node.js CI Build Status Coverage Status Codacy Badge License: MIT

A simple react component to write code snippets

Install

npm install cn-react-coda

How to use?

import React from "react"
import { Coda } from "cn-react-coda"

const example = `
  function fn(){
    console.log("Hello world!")
  }
`

export default function App(){
  return (
    <Coda lang="js" theme="dark" title="example.js" code={example} />
  )
}

Properties

Name Type Default Required Description
code string null yes Code snippet to be showed
title string null no Snippet title
theme string (dark, light) dark no Component theme
lang string jsx no Programing language, too see all suppport see hightlight.js

What's inside

Development

Test

npm run test

Build

npm run build

Lint

npm run lint

License

MIT © C4co

Readme

Keywords

none

Package Sidebar

Install

npm i cn-react-coda

Weekly Downloads

4

Version

1.1.8

License

MIT

Unpacked Size

45 kB

Total Files

13

Last publish

Collaborators

  • c4co