@singapore-editor/panes
v0.2.12
Published
Resizable split panes for browser DOM elements.
Maintainers
Readme
@singapore-editor/panes
Resizable split panes for browser DOM elements.
Part of Singapore. A code editor for the browser that keeps every version.
Install
npm install @singapore-editor/panesUsage
import { ResizablePaneGroup } from '@singapore-editor/panes'
const host = document.createElement('div')
host.style.cssText = 'height: 400px; width: 100%'
document.body.append(host)
const group = new ResizablePaneGroup(host, {
orientation: 'horizontal',
panes: [
{ id: 'files', element: document.createElement('div'), defaultSize: 30 },
{ id: 'editor', element: document.createElement('div') },
],
})
// Call group.dispose() when removing the panes.API highlights
ResizablePaneGroupowns panes and drag handles.getLayout()reads sizes by pane ID.setLayout()changes the split.
In the Singapore family
You can use this package on its own. @singapore-editor/core owns editor views; optional packages add syntax, search, gutters, and language features.
Singapore README · Documentation
License
MIT. License
