Skip to content

solidjs-community/solid-playground-editor-cm

Repository files navigation

Solid.js playground editor (codemirror)

Usage

Installation

npm add solid-playground-editor-cm

Component

// create fileName signal
const [fileName, setFileName] = createSignal("index.tsx");
// create fileSystem store
const [files, setFiles] = createStore({
  "index.tsx": "// Start here",
  "index.css": ".selector { display: block; }",
  "test.json": "{ test: 2 }",
  "index.html": "<!doctype html><html><head><title>Test</title></head><body></body></html>"
} as Record<string, string>);

return (
  <Editor
    files={files}
    setFiles={setFiles}
    fileName={fileName()}
    setFileName={setFileName}
    tsOptions={{ strict: false }}
  />
);

Installation and development

# install
npm i --legacy-peer-deps
# build
npm run build
# dev
npm run dev

About

codemirror6-based editor with typescript support for the solid.js playground

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published