@singapore-editor/solid
v0.2.15
Published
Solid bindings and reactive controls for the Singapore editor.
Maintainers
Readme
@singapore-editor/solid
Solid bindings and reactive controls for the Singapore editor.
Part of Singapore. A code editor for the browser that keeps every version.
Install
npm install @singapore-editor/core @singapore-editor/solid solid-jsUsage
Render this component in your app. Its host element gives the editor a fixed height.
import { createEditor } from '@singapore-editor/solid'
export function EditorPanel() {
const controller = createEditor({
document: {
documentId: 'example.ts',
defaultText: 'const value = 1\n',
languageId: 'typescript',
},
})
return <div ref={controller.ref} style={{ height: '400px' }} />
}API highlights
createEditor()creates a controller inside a Solid owner.controller.refmounts the view.controller.state()reads the current editor state.
In the Singapore family
@singapore-editor/core owns the editor view. This optional package adds Solid lifecycle and state bindings. Choose the other plugins your app needs.
Singapore README · Documentation
License
MIT. License
