react-interactive-cljs
v0.2.0
Published
Interactive cljs code blocks
Downloads
5
Readme
React Interactive ClojureScript
Displays highlighted ClojureScript that can be run in the browser
Uses react-syntax-highlighter and eval-cljs
npm i react-interactive-cljs
"use client"
import { CodeBlock } from "react-interactive-cljs"
export function Page() {
return (<CodeBlock>{`(println "Hello")
(+ 2 2)`}</CodeBlock>)
)
The code above will render like the image below
After clicking the "Run" button it will render like the image below
Accepts the same props as react-syntax-highlighter plus:
language
defaults to "clojure"allowEval
a boolean that defaults to true if the language is "clojure".
"use client"
import { Repl } from "react-interactive-cljs"
export function Page() {
return (<Repl defaultInput={`"Hello, World!"`} />)
)