npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ferdifighter/react-docking-layout

v0.3.0

Published

Eine flexible React-Komponente für Docking-Layouts ähnlich VS Code

Readme

@ferdifighter/react-docking-layout

Flexible, moderne Docking-Layout-Komponente für React – inspiriert von VS Code.

Ideal für komplexe Web-UIs, Admin-Tools, Editoren, IDEs und überall, wo du Panels flexibel anordnen, ein-/ausblenden und verschieben möchtest.


🚀 Schnellstart

npm install @ferdifighter/react-docking-layout

Wichtig: Importiere die CSS- und Theme-Dateien in deinem Projekt:

import "@ferdifighter/react-docking-layout/dist/styles.css";
import "@ferdifighter/react-docking-layout/dist/themes/dark.theme.css";
import "@ferdifighter/react-docking-layout/dist/themes/light.theme.css";

Minimalbeispiel:

import React, { useState } from 'react';
import { DockingLayout, DockingLayoutConfig } from '@ferdifighter/react-docking-layout';

const initialConfig: DockingLayoutConfig = {
  columns: [
    {
      id: 'left',
      width: 220,
      panels: [
        { id: 'explorer', title: 'Explorer', content: <div>Explorer-Inhalt</div> },
      ],
    },
    {
      id: 'center',
      panels: [
        { id: 'editor', title: 'Editor', content: <div>Editor-Inhalt</div> },
      ],
    },
    {
      id: 'right',
      width: 260,
      panels: [
        { id: 'outline', title: 'Outline', content: <div>Outline-Inhalt</div> },
      ],
    },
  ],
};

export default function App() {
  const [config, setConfig] = useState(initialConfig);
  return <DockingLayout config={config} onLayoutChange={setConfig} />;
}

✨ Features & Beispiele

1. Panel-Content: Beliebige Komponenten, Factories, Lazy-Loading

// Statischer JSX-Content
{ id: 'editor', title: 'Editor', content: <MeinEditor file="readme.md" /> }

// Dynamisch per Factory
{ id: 'editor', title: 'Editor', content: (panel) => <MeinEditor file={panel.file} /> }

// Mit contentRenderer für maximale Flexibilität
<DockingLayout
  config={config}
  contentRenderer={panel => typeof panel.content === 'function' ? panel.content(panel) : panel.content}
/>

2. Panel schließen, ein-/ausblenden, Events

const [closedPanels, setClosedPanels] = useState<string[]>([]);

<DockingLayout
  config={config}
  closedPanels={closedPanels}
  onPanelClose={id => setClosedPanels(panels => [...panels, id])}
/>

3. Theme wechseln (Light, Dark, Auto)

<DockingLayout config={config} theme="dark" />
<DockingLayout config={config} theme="light" />
<DockingLayout config={config} theme="auto" />

4. Panel-spezifisches Styling per API

<DockingLayout
  config={config}
  panelStyles={{
    explorer: { panel: { backgroundColor: '#e3f2fd', borderColor: '#2196f3' } },
    terminal: { panel: { backgroundColor: '#222', color: '#fff' } },
  }}
/>

5. Dynamische Styles (z.B. Zustand, User-Settings)

const [activePanel, setActivePanel] = useState('editor');

<DockingLayout
  config={config}
  panelStyles={{
    [activePanel]: { panel: { borderColor: 'red', boxShadow: '0 0 0 2px red' } }
  }}
/>

6. Panel gezielt per CSS oder data-Attribut stylen

/* Per CSS-Klasse */
.docking-panel--id-explorer {
  background: #e0f7fa;
  border-color: #00bcd4;
}
/* Per data-Attribut */
.docking-panel[data-panel-id="terminal"] {
  background: #222;
  color: #fff;
}

7. Globale Styles für alle Panels

<DockingLayout
  config={config}
  globalStyles={{
    panel: { borderRadius: '8px', boxShadow: '0 2px 8px rgba(0,0,0,0.1)' },
    header: { fontSize: '15px', fontWeight: 'bold' },
  }}
/>

8. Events & Callbacks

<DockingLayout
  config={config}
  onLayoutChange={newConfig => console.log('Layout geändert:', newConfig)}
  onPanelClose={panelId => alert('Panel geschlossen: ' + panelId)}
/>

9. Responsives Verhalten & Custom CSS

@media (max-width: 800px) {
  .docking-layout {
    flex-direction: column;
  }
}

📚 API-Referenz (Auszug)

DockingLayoutConfig

interface DockingLayoutConfig {
  columns: DockingColumnConfig[];
  className?: string;
  style?: React.CSSProperties;
  theme?: 'light' | 'dark' | 'auto';
}

interface DockingColumnConfig {
  id: string;
  width?: number | string;
  panels: DockingPanelConfig[];
}

interface DockingPanelConfig {
  id: string;
  title: string;
  position?: 'left' | 'right' | 'top' | 'bottom' | 'center';
  size?: number | string;
  minSize?: number;
  maxSize?: number;
  resizable?: boolean;
  collapsible?: boolean;
  collapsed?: boolean;
  closable?: boolean;
  pinned?: boolean;
  content?: React.ReactNode | ((panel: DockingPanelConfig) => React.ReactNode);
  className?: string;
  style?: React.CSSProperties;
}

DockingLayout Props

interface DockingLayoutProps {
  config: DockingLayoutConfig;
  onLayoutChange?: (layout: DockingLayoutConfig) => void;
  className?: string;
  style?: React.CSSProperties;
  theme?: 'light' | 'dark' | 'auto';
  contentRenderer?: (panel: DockingPanelConfig) => React.ReactNode;
  panelStyles?: Record<string, PanelStyleConfig>;
  globalStyles?: StyleConfig;
  enablePanelStyling?: boolean;
}

PanelStyleConfig (API für dynamische Styles)

interface PanelStyleConfig {
  panel?: React.CSSProperties;
  header?: React.CSSProperties;
  content?: React.CSSProperties;
  // ...weitere Bereiche (Tabs, ResizeHandle, Overlay, etc.)
  className?: { panel?: string; header?: string; ... };
  cssVariables?: Record<string, string>;
}

🛠️ Entwicklung & Beitrag

git clone <repo-url>
cd react-docking-layout
npm install
npm run dev

Pull Requests & Issues sind willkommen!


Fragen, Wünsche, Feedback? Erstelle ein Issue oder schreib mir direkt!