Skip to content

thiagooak/react-interactive-cljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!"`} />)
)

About

Interactive cljs code blocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published