Skip to content

About

πŸš€ JavaScript package πŸ“¦ for creating dynamic layouts πŸͺŸ with ease πŸ’€.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

21 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

280 Commits

Folders and files

Repository files navigation

🧩 Dynamix Layout

Dockable, resizable tab layouts like VS Code's, for React and Solid, built on a framework-agnostic core.

npm: @dynamix-layout/react npm: @dynamix-layout/solid npm: @dynamix-layout/core License

Patreon Buy Me A Coffee Hire Me

Live Demo

Dragging tabs between panels and resizing them

Your tabs live in tabsets, arranged in rows and separated by draggable splitters. Users drag tabs to rearrange or split panels, resize them, and maximize or fold a panel. The layout is plain JSON you can save and restore.

Features

  • Drag tabs onto another tab bar, onto a panel's side to split it, or onto a layout edge. Works with mouse, pen and touch.
  • Resize with splitters that respect minimum sizes. Only the two neighbouring panels move.
  • Maximize a panel, or fold it to a strip, and get back the exact previous size.
  • Tab content never remounts when tabs move, so editors, terminals and iframes keep their state.
  • Save and restore the layout as versioned JSON. Layouts saved by v1 load automatically.
  • Accessible: WAI-ARIA tabs and window splitter patterns, keyboard resizing, and a keyboard move mode.
  • SSR-safe and fast: deterministic server markup, and drags and resizes never re-render React.
  • Three levels of API: one component, headless hooks, or the framework-agnostic core.

Packages

Package
@dynamix-layout/react <DynamixLayout> and headless hooks for React 18 and 19
@dynamix-layout/solid <DynamixLayout> for SolidJS
@dynamix-layout/core The engine: tree, geometry, drag-and-drop and serialization, with no framework

Quick start (React)

npm install @dynamix-layout/react
import { DynamixLayout } from '@dynamix-layout/react'
import '@dynamix-layout/react/styles.css'

const tabs = [
	{ id: 'editor', title: 'Editor', content: <Editor /> },
	{ id: 'terminal', title: 'Terminal', content: <Terminal /> },
	{ id: 'preview', title: 'Preview', content: <Preview /> },
]

export function App() {
	return (
		<div style={{ height: '100vh' }}>
			<DynamixLayout tabs={tabs} />
		</div>
	)
}

To save the layout, store what onLayoutChange gives you and pass it back as defaultLayout; see Persisting layouts.

Documentation

Contributing

Issues and pull requests are welcome; see CONTRIBUTING.md and the issue tracker.


Made with ❀️ by Akash Aman

MIT License

About

πŸš€ JavaScript package πŸ“¦ for creating dynamic layouts πŸͺŸ with ease πŸ’€.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

21 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages