cn-react-coda
v1.1.8
Published
Simple component to document react components
Downloads
4
Readme
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